Stop player's rotation and movement
I have 4 buttons in a scene to control the rotation and movement of the player.
A button to move the player left
A button to rotate the player left
A button to move the player right
A button to rotate the player right
2 walls to keep the player within the scene.
Moving the player left or right and reaching either wall will stop the player from moving further.
When the player reaches the left wall and I press the rotate left button, the player will push itself off the wall, continue to rotate left and move to the right. This also happens when the player reaches the right wall. Rotating right and hitting the right wall will keep the player rotating to the right and move the player to the left.
Only when I press another button will the rotation and movement stop.
What's the best way to stop the player from rotating and moving when hitting the wall?