Game Development Reference
In-Depth Information
Tip
When using the Mecanim system for AI, be sure to always check your default values for
properties.
Animation, states, and looping
The second issue is a bit more conventional and just requires a bit more knowledge about
the new animation system, as by default, all the animations will loop forever.
To stop an animation from looping, you would normally just transition it to another anim-
ation state in the Mecanim animator view when it is complete (the condition
Exit Time =
0.9
). However, in this case, our animation is the final resting state, and as stated, with
nowhere to go, the animation state will just loop forever.
To change this, we simply need to alter the animation clip's import settings to denote it is
a static animation and not a looping one (by turning off looping).
So, navigate to
Assets\Animation\Clips
and select the
GoblinDeath
animation
clip. Then, in the
Inspector
window, uncheck the
Loop Time
option as shown in the fol-
lowing screenshot: