In this recipe, we create and set up the transition for the character to switch between the Idle and Jump animation clips. For this task, we also need a parameter, which we will call bJump
, to trigger the jump animation through code.
We will build on the previous recipe. Have the Animator window open, and be ready to follow our instructions.
As you move to the Animator panel in Unity, you should see a orange box representing the Idle animation, from our previous recipe. If it is not, right-click on it, and from the menu, select Set As Default. You can refer to the following screenshot:
Right-click on the Idle clip and select Make Transition from the menu, as shown in the following screenshot:
Drag the arrow that appears onto the Jump clip and click to create the transition. It should appear in the Inspector window, to the right of the Animator window. Check the following screenshot to see whether you did it right: