User Tools

Site Tools


rainelements:basicanimator

Basic 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.

Actions

  • Clear Animations: This will clear any animation states that have been setup for this animator.
  • Add Existing Animations: This will look for an Animation Component on the AI Body and automatically add an animation state for each animation clip it finds on the component.
  • Add New Animation: This adds an empty animation state.

Usage

The BasicAnimator is for playing legacy animations. Essentially it allows you to build states that can be called from an Animate node or from code.

  • State Name: The name of the state. This will be the name you call from the behavior tree or code.
  • Animation Clip: The legacy animation clip to play.
  • Layer (Advanced): The layer to play it the clip on, higher layers will override lower ones.
  • Weight (Advanced): The weight, or how much influence, that the animation has (1 is 100%).
  • Speed: The speed to play the animation at.
  • Fade In Time: The amount of time to use to fade animation in.
  • Fade Out Time: The amount of time to use to fade the animation out.
  • Wrap Mode: The wrap mode to use when playing the animation.
    • Default: Use whatever the clip has specified in its settings.
    • Clamp: Play the clip once and reset it to the beginning.
    • Once: Play the clip once and reset it to the beginning.
    • Loop: Play the clip and continue playing it at the beginning when it finishes.
    • PingPong: Play the clip forward until the end, then play it backwards until the beginning, and so on.
    • ClampForever: Play the clip and stay at the end when finished.
  • Mixing Transforms (Advanced): Allows you to specify which transforms to use when blending the animation with lower layers.

Many of these options mirror what is present in Unity already and are covered in depth on their Animation page.

The Basic Animator was an early attempt to handle the lack of an animation state machine in Unity (and to expose this to RAIN's behavior trees). A much better option is to use the Mecanim Animator and Animator to create a full animation state machine.

Code

See Also

rainelements/basicanimator.txt · Last modified: 2022/08/13 18:13 (external edit)