title: How to change the input direction of the virtual joystick according to the rotation of the camera so that the player advances?
body: <p>I have a field with a josytick it worked fine and everything but when I turn the camera the player doesn't move in the right direction, I want him to move in the right direction but he moves in the opposite direction. Here is my code if you can help me? please.</p>
  <pre><code>public float speed;
  public float rotationSpeed;
  private CharacterController characterController;
  public FixedJoystick moveJoystick;
  private Animator _animator;
  
  void Start()
  {
      characterController = GetComponent&lt;CharacterController&gt;();
      _animator = GetComponent&lt;Animator&gt;();
  }
  
  void Update()
  {
      float horizontalInput = moveJoystick.Horizontal;
      float verticalInput = moveJoystick.Vertical;
  
      Vector3 movementDirection = new Vector3(horizontalInput, 0, verticalInput);
  
      float magnitude = Mathf.Clamp01(movementDirection.magnitude) * speed;
      movementDirection.Normalize();
      
      transform.Translate(movementDirection * magnitude * Time.deltaTime, Space.World);
      Vector3 velocity = movementDirection * magnitude;
      characterController.Move(velocity * Time.deltaTime);
  
      if (movementDirection != Vector3.zero)
      {
          _animator.SetBool(&quot;caminar&quot;, true);
          Quaternion toRotation = Quaternion.LookRotation(movementDirection, Vector3.up);
          transform.rotation = Quaternion.RotateTowards(transform.rotation, toRotation, 
          rotationSpeed * Time.deltaTime);
      }
      else
      {
          _animator.SetBool(&quot;caminar&quot;,false);
      }
  }
  </code></pre>