Hi,
I have started working on a project, I have been working on character movement, Im new to unity and have been following a video, Im using Input actions, Vector2 to move my character, its a first person character. But after setting up movement, the character moves left and right, but not forward and back, in fact they go up and down. Of course I know Vector 2 only works in the X & Y axes. But the person in the video I was using worked fine, and I followed it with 0 changes.
I have attached the text of the coding below, im sure it is a simple fix, I just need help with it >.<
Thanks!
//receive the inputs for our InputManager.cs and apply them to our character controller
public void ProcessMove(Vector2 Input)
{
Vector3 moveDirection = Vector3.zero;
moveDirection.x = Input.x;
moveDirection.y = Input.y;
controller.Move(transform.TransformDirection(moveDirection) * speed * Time.deltaTime);
playerVelocity.y += gravity * Time.deltaTime;
if (isGrounded && playerVelocity.y < 0)
playerVelocity.y = -2f;
controller.Move(playerVelocity * Time.deltaTime);
UnityEngine.Debug.Log(playerVelocity.y);
}