Game Development Reference
In-Depth Information
With the zombie_lowres game object selected, play to test. The zombie is walking in place as
before, because the WalkX and WalkZ values are initially set to 0 in the ZombieMotionController
script. While still in Play mode, try adjusting the WalkX and WalkZ values in the Inspector.
Fine-tune them until the zombie appears to walk across the plane without any drift. Remember to
make note of your final values before exiting Play mode, since your changes will not be saved in
the Inspector.
Transitions
So far you've only worked with the default animation state. State machines can be quite complex,
incorporating any number of animation states that you might need for your character. Moving from
one animation state to another is called a transition .
For this last Animation Controller you will need to download and import Unity's Mecanim Locomotion
Starter Kit from the Asset Store (Figure 5-35 ). This package has a ready-made Mecanim rig and
controller for you, but to understand how it works you will use a few of its animations to build a
controller from scratch.
Figure 5-35. Mecanim Locomotion Starter Kit in the Unity Asset Store
 
Search WWH ::




Custom Search