When I press the A button, then quickly press the D button, and then release the D button, my character starts to run left while facing right. And vice versa: When I press the D button, then quickly press the A button, and then release the A button, my character starts to run right while facing left. Maybe someone knows how to fix this. My code for the player's movement looks like this: