Flipping the character based on direction in Unity
Right now, our Player runs and jumps backward when moving left. It’s time to make the character face the other direction first before performing those actions. Luckily, it all depends on value of getting horizontal input.
When left is pressed, the value is -1. When it’s idle, it’s 0. When right is pressed, the value is 1.
From here you can just flip the y axis of transform.localEulerAngles to flip the character as well.
Now, the Player faces the direction of movement.