Hello,
I’m developing a 2D top-down game where the player controlled by 8 direction keyboard movement. For this movement I’m using lerp along with horizontal and vertical axis. I programmed the facing direction properly while the player is moving, but when he is stop (release arrow keys) the facing direction set back the default “look forward” state. It’s unacceptable as he need to face the same direction when he stopped.
rigidb.velocity = new Vector2(Mathf.Lerp(0, Input.GetAxis("Horizontal") * walkSpeed, 0.25f),
Mathf.Lerp(0, Input.GetAxis("Vertical") * walkSpeed, 0.25f));
transform.up = rigidb.velocity;
How can I fix this issue? It is really annoying for me!