Character moving backwards when I press the forward key (w) and moving forward when pressing backwards (s),Character going backwards when pressing the forwards key (w)
void Update() {
float x = Input.GetAxis("Horizontal");
float z = Input.GetAxis("Vertical");
Vector3 move = transform.right * x - transform.forward * z;
controller.Move(move*speed*Time.deltaTime);
Answer by AnthonySpering · 4 days ago
Make sure the camera is lined up correctly. Let's say the player is at positon 0 on the z axis and the camera is on z axis 10 when you press the forward key (W) it will look like the player is moving backwards because your camera is not in the correct position to fix this you need to change the camera on the Z axis from 10 to negative 10 and rotate it so that it is facing the player. In other words, your script was right but to solve your problem you just need to change the position of the camera. @PotatoDashYT
Your answer
Follow this Question
Related Questions
I want to make an on click movement script with a grid type map need references to look at 0 Answers
First Person camera can't look vetically 0 Answers
NullReferenceException: Object reference not set to an instance of an object error 1 Answer
Character movement 1 Answer
Character Jump? Alter the Y axis during Vector3.MoveTowards? 1 Answer