The Gesture system allows characters to play a single animation that stops after it finishes. This is specially useful for animations such as a character throwing a punch, vaulting an obstacle or waving a hand.
These animations are always played on top of any other animations.
The easiest way to play a Gesture animation is using the Play Gesture instruction, which has a few configuration parameters.
Too many options?
It may seem a bit overwhelming the amount of parameters available for a single animation. Note that the most important ones are the Character and Animation Clip fields. The rest can be left with their default values and should work on most cases.
The Character field determines the object that the animation clip will be played. The game object referenced must contain a
Character component in order to work. Otherwise the instruction will be skipped.
The Animation Clip references an animation asset. Without this field the instruction will not work.
The Avatar Mask is an optional field that determines which parts of a character will play the animation and which won't. If this field is left empty the whole body will play the animation. For more information about masking animations, see the Unity documentation about Avatar Masks.
The Blend Mode field determines whether the animation clip overrides or adds up its movement on top of any other animations being played.
- Blend: The default parameter. Blend overrides any animations and plays the animation clip on top of them. This is the most common option for most animations.
- Additive: This blend mode allows to play an animation by adding up the motion on top of any other clips being played.
The Delay field allows to start playing the animation after a certain amount of seconds have passed. If the value is set to zero the animation will start to play immediatelly.
The Speed field is a coefficient that determines the speed at which the animation is played. A value of 1 plays the animation at its original speed. Higher values will play the animation faster while lower ones will play the animation slower. For example a value of 2 will play the animation twice as fast.
Determines whether this animation should take control over the character and use its root motion to also move and rotate it. Notice that using root motion takes control of the character while the animation plays and the user's input will be ignored.
The Transition In field determines the amount of seconds the animation will take to blend between the current animation and the new Gesture animation clip.
Similarly, the Transition Out field determines how much time, in seconds, it takes to blend out the current gesture animation to the animation being played underneath.
Wait to Complete¶
The Wait to Complete checkbox allows the instruction to be put on hold and only continue once the animation finishes. This is specially useful when chaining multiple gestures one after another.
For more information about how to use instructions to interact with other systems, see the Visual Scripting section.