User Tools
Sidebar
Using RAIN
AI Characters
Environment
rainelements:mecanimanimator
Table of Contents
Mecanim Animator
Properties
- Use Unity Messages (Advanced): Whether the AI is initialized and updated by Unity or done manually.
- Use Fixed Update (Advanced): Whether the AI responds to Unity Update or FixedUpdate messages. Only valid if Use Unity Messages is checked.
- Is Active (Advanced): Whether the AI is currently updating.
- Body: The GameObject that the AI will move and animate.
- Animator: The type of animator used. Currently RAIN supports a Basic Animator and Mecanim Animator. If you create your own Custom Animator you can select it here.
Actions
- Clear Animations: This will clear any animation states that have been setup for this animator.
- Add New Animation: This adds an empty animation state.
Usage
The Mecanim Animator allows you to create animation states that you can call from the Animate node.
- Mecanim State: The Animation State to monitor in the Animator Controller. Instead of the name this can also be a Tag, which can be shared by several states.
- Layer: The layer to monitor for the Mecanim State.
- Start/Stop Parameter: The parameter to set before starting or stopping the state.
- Parameter Name: The name of the Animation Parameter to set.
- Parameter Type: The type of parameter.
- Parameter Value: An expression to evaluate and assign to this value.
- Damp Time: Smooths any change to the parameter by this much time, only valid for the Float type.
When one of these states are played (either through the Animate node or through code) the Mecanim Animator does the following:
- Sets the Start Parameter to the given value.
- Waits until Mecanim State is done playing.
- Sets the Stop Parameter to the given value.
Since Mecanim State can also represent a Tag (located on the Animation State under its name), it can be used to monitor a string of animations, as long as all of their tags are assigned the same name.
Code
See Also
rainelements/mecanimanimator.txt · Last modified: 2022/08/13 18:13 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported