Reversed Keyboard Function AWSD

So I want to ask why my W key moves backward and my S key moves forward, while A and D work correctly for left and right. Could this be because my object is rectangular?

It could be that the axis is upside down, meaning the forward axis is pointing back. It could also mean that the math to move is incorrect. Without seeing anything I can’t say for sure

Hi Tester,

A typical problem in this context is a rotated camera (usually Main Camera) because we move our player along the global axes, not along the local axes of the camera. Or the scale values of the camera game object are negative.

However, bixarrio is right. Without knowing anything about your game, we can only guess. If our answers didn’t help you, please share more information on what you did and have in Unity.


See also:



I fixed the W&D by replacing my object and recreated the virtual camera, however similiar problem arose in the “A” and “D” command.

Please note, it’s better to copy/paste your code and apply the code fencing characters, rather than using screenshots. Screenshots are ideal for displaying specific details from within a game engine editor or even error messages, but for code, they tend to be less readable, especially on mobile devices which can require extensive zooming and scrolling.

You also prevent those that may offer to help you the ability to copy/paste part of your code back to you with suggestions and/or corrections, meaning that they would need to type a potentially lengthy response. You will often find that people are more likely to respond to your questions if you make it as easy as possible for them to do so.

Regarding the remaining problem with the A and D key, have you already tried to add Debug.Logs to your code to see what is going on during runtime?

Hope this helps. :slight_smile:


See also:

Notedd thankyou for the explanations and reply, I fixed this issue by asking chatgpt, adding:

Vector3 move = new Vector3(xValue, 0f, zValue);
transform.Translate(move, Space.World);

on void update

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms