Problem with character rotation

Hi everyone, I’ve got a small problem when rotating the character. I’m making a small isometric prototype and now the character behaves almost perfectly, but there is a small problem with keyboard control. If you move diagonally and slightly unevenly release the movement keys, the character turns towards the last released key. Is there any way to smooth out the input to make the character less responsive (as weird as that sounds). I added an arrow to the video to show what I mean.


Tried to turn the character only during movement, then this option is not suitable because when you press the key once, the character does not turn fully in the desired direction.

Also attached is a realization of the motion and rotation.


Any ideas would be greatly appreciated, thank you!