Double-click on Packt_Animator
from the
Project panel to open the Animator panel in Unity. If you messed up a little with it, delete anything except the default Idle node.
Create three new empty states by right-clicking anywhere in the Animator window, then select Create State and Empty, as shown in the following screenshot. Name them runRight, runLeft, Idle and Jump.
Add the run animation clip to both runRight and runLeft states, as shown in the following screenshot:
Lastly, add the jump_pose clip to the Jump state. Here's a screenshot, just in case:
Now we can take care of the transitions. First of all we need two variables: a float called fSpeed to check whether we should trigger the left or the right sided running animation, and a Boolean called bJump for jumping. You should remember how to do this. The following screenshot shows what you are searching for:
Create a new transition from Idle to runRight, and in the Inspector panel, set the condition to...