Game Development Reference
In-Depth Information
Note The various animations are called states . For example, when a character is at Idle, it is in the “Idle
state.” Moving from one state to another is a transition , denoted by an arrow. The compilation of states and
transitions that you design in the Animator window for your Animator Controller represent what is called a
state machine .
That's it for a simple animation controller that will plays the alpha@zombie_running animation clip as
its default.
Run Zombie Run
First set up the scene. In the Hierarchy view, select the Cube game object, then in the Inspector
deactivate it by unchecking the box at the top by its name. Now drag the zombie_lowres model from
the Project panel into the Hierarchy view to add it to the Scene. Select Main Camera and see how
the preview looks. Reposition the camera to (0, 1, -3). The zombie character appears in the scene
facing away from the camera, so select it in the Hierarchy and change the y value of its Rotation
property in the Inspector to 180 to turn it around. Reselect the Main Camera to see a preview of this
new orientation
Now take a look at the zombie character's Animator component in the inspector, and you'll notice
that its Controller property is empty. Drag the zombieController01 from the Project panel and drop it
into the Controller field (Figure 5-21 ). Save the scene. Play and now the zombie is running after you!
Figure 5-21. The zombie_lowres Animator component and zombieController01 in the Inspector
 
Search WWH ::




Custom Search