Defines a single state that the controller can be in. Each state contains either a single AnimNode or a AnimBlendTree of multiple AnimNodes, which will be used to animate the Entity while the state is active. An AnimState will stay active and play as long as there is no AnimTransition with its conditions met that has that AnimState as its source state.

Constructors

Constructors

  • Create a new AnimState instance.

    Parameters

    • controller: AnimController

      The controller this AnimState is associated with.

    • name: string

      The name of the state. Used to find this state when the controller transitions between states and links animations.

    • Optionalspeed: number = 1

      The speed animations in the state should play at. Individual AnimNodes can override this value.

    • Optionalloop: boolean = true

      Determines whether animations in this state should loop.

    • OptionalblendTree: any

      If supplied, the AnimState will recursively build a AnimBlendTree hierarchy, used to store, blend and play multiple animations.

    Returns AnimState