Game Development Reference
In-Depth Information
Speed is useful when a character is being controlled by something other than the player. Typically
this could be an NPC (non-player character) that is run by an AI system. Speed is also useful even
when the player is controlling the character. If the character was taken down a steep slope and the
sliding effect added to the speed, you could transition the character into and out of a run based
solely on its forward velocity. In that scenario, the parameters would represent velocity rather than
input values.
In the last test, you saw how Mecanim uses the motion information on the Root Node object
(that you specified in the Rig section) to transform (in this case move) the character and play the rest
of the objects' animations. As long as only the base transforms are on the root node object, you can
have Mecanim suppress them and allow the character controller, or other scripts, to manage the
transforms.
1.
Select the GardenGnome in the Hierarchy view.
2.
In the Animator component, uncheck Apply Root Motion.
3.
Click Play.
The character no longer moves forward.
4.
Switch to the Animator view, and watch the progress bars loop from one state
to the other.
5.
Switch to the Scene view, and zoom in on the character.
You will see that the two clips are still being triggered just as before. The main indicator is the switch
position on the motor. When you finish setting up the character in Chapter 7, you will be using the
First Person Controller to control the main movement, so you will be suppressing the root node
motion that came in with the animations.
6.
Stop Play mode.
7.
Drag the GardenGnome into the Prefab's Characters folder.
Humanoids
The driving force behind Mecanim development is humanoid characters. With them, you can take
advantage of Mecanim's powerful retargeting system by starting with a rigged character and using
a large variety of animation clips. A short, broad character can easily use the same animation as a
tall lanky character. The only caveat is that the animation clips must all come from a character of the
same build.
To qualify as a Humanoid Animation Type, your character must have at least 11 bones and be
roughly humanoid—a bipedal creature with no extra limbs, tails, wings, or other accessories. You
can have the extras, but you would be required to animate them with masks and layers if they
required controls. The character must also be rigged. Rigging is the process of associating a
skeleton, a hierarchy of bones, with a mesh. Each vertex on the mesh is controlled by at least one
bone. The more bones controlling the position of a vertex, the higher the overhead. Unity lets you
select the maximum number of bones allowed to affect a vertex in its Quality Settings.
 
Search WWH ::




Custom Search