Left key and right key not working player is not moving please help


Welcome to our community! :slight_smile:

First of all, save your script. In your last screenshot, I can see an asterisk, which indicates that the changes in the script were not saved.

Once you saved it, test your game again. Are there any error messages in your console when you try to rotate your car while playing your game?

If not, add Debug.Logs to your code so see if the if and else-if blocks get executed at runtime. Bear in mind that the LeftArrow and RightArrow keys refer to the four arrow keys on your keyboard, not to the numpad arrows.

See also:

Torque changes the angular velocity of the Rigidbody2D, i.e. It rotates it. You have locked your rotation

thank you bixarrio its the locked rotation

thanks nina i locked my z rotation thats why it was not rotating

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

Privacy & Terms