How do i make a unit rotate, when moved by keyboard?

i am making a tank, and i want it to rotate when i press a to the left, d to right etc.

2 Likes

To make the tank continuously rotate while you hold the key down, I would make an entity variable on the unit to keep track of whether A or D is pressed, and have an entity-script on the unit running every frame that will rotate the unit according to the value of its variable.
Here’s a minimal example:





2 Likes