I am trying to move my character in the direction of its movement. But when i try to move it … all directions are inverted. For example,… i move forward… it goes backward… similar for all directions.
This is the code i use in my update function
var controller : CharacterController = GetComponent(CharacterController);
moveDirection = Vector3(Input.GetAxis("Horizontal"), 0,Input.GetAxis("Vertical"));
if (moveDirection != Vector3.zero)
{
transform.forward = Vector3.Normalize(moveDirection);
}
moveDirection *= speed;
// Apply gravity
moveDirection.y -= gravity * Time.deltaTime;
// Move the controller
controller.Move(moveDirection * Time.deltaTime);
Need urgent help…