Player Animations Part 4

Simon Leen
Aug 30, 2021

Objective: Set up Players Animations for Forward Direction

So far we have our animations working bar, if we go backwards or move in the left direction, the Player moves in what looks like an over agressive moonwalk or running man motion.

To fix this we will start with an if statement to check if the Player is not standing still. Inside that then we create a Vector3 with the value of the Players transform.localEulerAngles which are the orientation of the Players rotation. We then set the y rotation using a ternary to set it to 0 or 180 degrees based on if the Player is moving left or right. Finally we set the Players rotation of localEularAngles to the ternary result.

--

--