The game
In this chapter, the goal for our game is to apply the walk animation when the player is moving. Furthermore, we will prepare the jump animation for the next chapter. To achieve that, we need to set up the rest of the transitions.
In the Animator window, let's add a new transition from WalkAnim
to Idle
and name it StopWalking
. Then, we need to add a condition that will trigger the transition. This transition will use the parameter PlayerSpeed so that when its value becomes less than one the transition is triggered.
Now that the transitions between Idle
and WalkAnim
are ready, let's do the same to the JumpAnim
state.
We need to make a transition from the Idle
state to the JumpAnim
state and vice-versa; we will name them StartJump
and EndJump
, respectively.
However, we are going to need another parameter to see if the player is currently jumping. We can do this by adding another parameter named Jump
as a Boolean in the Animator window and set it to false
.
This is what the...