Game Development Reference
In-Depth Information
Figure 8.2
An animated ver-
sion of the game
zombie. The active
portion of the time-
line (light gray) has
an idle animation
whereas the inac-
tive portion (dark
gray) has a walk
animation.
This script is part of a larger one that controls zombie movement and animation. This
part of the script, known as a function , tells the zombie mesh to play the “idle” animation
with the animation.Play command and tells the zombie object to play an idle sound pro-
vided by the user.
Other parts of the script reference the Idle() function and tell it when to activate. The
whole script, which you will use in the next chapter, also controls the other movement
variables for the zombie object. In this and many other scripts, moving an object involves
assigning a walk or run speed to specific animations, so as the zombie walks the script
will tell it to move forward at a specified speed value. Because the script handles the for-
ward movement of the character object, game characters must be animated moving in
place in Blender so the animation looks smooth as it is implemented by Unity.
For standing animations such as idle animations—where the character moves around
when the player isn't pressing buttons—and others such as reloading a gun or talking,
animating in place is simple. However, many new animators have trouble conceptualizing
actions like walking and running without forward movement. This is where more tradi-
tional techniques for planning your animations come into play.
Search WWH ::




Custom Search