Implementing the turn animation
In this case, there is a single animation sequence that will be played when the zombie is turning to the right or left.
The FBX file containing the animation has already been imported. The next step is to add the resulting motion clip to the animator controller in its own state.
Adding the turning state
The turn animation is a single looping sequence used for a left or right turn:
Make sure that the Animator panel is visible and the base layer is active.
In the Project panel, locate the
PACKT_Animations
folder and click on it once to view its contents in the Assets panel.Locate the
zombie_turn
asset and expand its hierarchy by clicking on the arrow next to its name.Drag the
zombie_turn
animation into a blank area of the Animator panel to create a new state containing the clip.In the Inspector panel, rename the state
Turn
:
Next, we will set up an appropriate parameter and create transitions to and from our existing states.
Setting up the IsTurning parameter
We want...