void Update() { if (GameController.instance.gamePaused) { return; } // Caméra // Horizontal (on bouge le corps) transform.Rotate(Vector3.up * Input.GetAxis("Mouse X") * mouseSensitivityX); // Vertical (on bouge la caméra) // On clamp la rotation avant de changer le transform verticalLookRotation += Input.GetAxis("Mouse Y") * mouseSensitivityY; verticalLookRotation = Mathf.Clamp(verticalLookRotation, -60f, 60f); cameraTransform.localEulerAngles = Vector3.left * verticalLookRotation; // Déplacement float inputX = Input.GetAxisRaw("Horizontal"); float inputY = Input.GetAxisRaw("Vertical"); Vector3 moveDirection = new Vector3(inputX, 0f, inputY).normalized; Vector3 targetMoveAmount = moveDirection * walkSpeed; moveAmount = Vector3.SmoothDamp(moveAmount, targetMoveAmount, ref smoothMoveVelocity, 0.15f); // Lâcher de drapeau if (hasFlag) { if (Input.GetButtonDown("Fire1")) { LeaveFlag(); } } // Si le joueur est en l'air, on cherche quelle planète est la plus proche if (!grounded) { gravityScript.ChangePlanetAttractedTo(); } UpdateAnimator(); }