The AnimatorController is used to control the playback of animations. It is used by the Animator component. It is using a state machine to control the playback of animations.
To create an animator controller use the static method AnimatorController.createFromClips(clips: AnimationClip[], options: CreateAnimatorControllerOptions)

Constructors

Properties

animator?: Animator

the animator that this controller is bound to

model: AnimatorControllerModel

the model that this controller is based on

normalizedStartOffset: number = 0

The normalized time of the start state. This is used to determine the start time of the first state.

Accessors

  • get activeState(): State
  • Get the currently active state playing

    Returns State

    the currently active state or undefined if no state is active

  • get currentAction(): any
  • Get the current action (shorthand for activeState.motion.action)

    Returns any

    the current action that is playing. This is the action that is currently transitioning to or playing. If no action is playing null is returned.

Methods

  • Parameters

    • name: string | number

    Returns State

    Deprecated

    use findState

  • Bind the animator to the controller. Only one animator can be bound to a controller at a time.

    Parameters

    Returns void

  • Clears the animation mixer and unregisters it from the context.

    Returns void

  • Returns Generator<AnimationAction, void, unknown>

  • Parameters

    • name: string | number

    Returns State

  • Parameters

    • name: string | number

    Returns boolean

  • Parameters

    • name: string | number

    Returns number

  • Parameters

    • name: string | number

    Returns number

  • Parameters

    • name: string | number

    Returns boolean

  • Returns boolean

  • Parameters

    • name: string | number
    • layerIndex: number = -1
    • normalizedTime: number = Number.NEGATIVE_INFINITY
    • durationInSec: number = 0

    Returns void

  • Returns void

  • Parameters

    • name: string | number

    Returns void

  • Parameters

    • name: string | number
    • value: boolean

    Returns void

  • Parameters

    • name: string | number
    • val: number

    Returns boolean

  • Parameters

    • name: string | number
    • val: number

    Returns void

  • Set the speed of the animator controller. Larger values will make the animation play faster.

    Parameters

    • speed: number

    Returns void

  • Parameters

    • name: string | number

    Returns void

  • Called by the animator. This will update the active states and transitions as well as the animation mixer.

    Parameters

    • weight: number

    Returns void

  • Create an animatorcontroller. States are created from the clips array.

    Parameters

    • clips: AnimationClip[]

      the clips to assign to the controller

    • options: CreateAnimatorControllerOptions = ...

      options to control the creation of the controller.

    Returns AnimatorController

    the created animator controller

Generated using TypeDoc