• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    Animator

    Inherits from:

    The Animator class is a core component in Unity for managing animations. It works with the Animator Controller to manage states and transitions in a state machine, enabling complex animation setups. This class provides a variety of methods and properties to control animations on GameObjects, essential for dynamic and interactive game environments. Unity's Animator Documentation

    Properties

    angularVelocity

    ClientOnly
    ReadOnly

    Returns the angular velocity vector of the GameObject. Unity's Animator.angularVelocity Documentation

    applyRootMotion

    boolean
    ClientOnly

    Controls whether root motion in animations should be applied to the GameObject. Unity's Animator.applyRootMotion Documentation

    avatarRoot

    ClientOnly
    ReadOnly

    Refers to the root Transform of the humanoid Avatar in the animator. Unity's Animator.avatarRoot Documentation

    Allows getting or setting the position of the body mass. Unity's Animator.bodyPosition Documentation

    Lets you get or set the rotation of the body mass. Unity's Animator.bodyRotation Documentation

    deltaPosition

    ClientOnly
    ReadOnly

    Returns the GameObject's position change during the last frame. Unity's Animator.deltaPosition Documentation

    deltaRotation

    ClientOnly
    ReadOnly

    Provides the rotation difference of the GameObject during the last frame. Unity's Animator.deltaRotation Documentation

    feetPivotActive

    number
    ClientOnly

    A blend variable for calculating the position of each foot during a transition. Unity's Animator.feetPivotActive Documentation

    fireEvents

    boolean
    ClientOnly

    Dictates whether the Animator is allowed to emit events. Unity's Animator.fireEvents Documentation

    gravityWeight

    number
    ClientOnly
    ReadOnly

    Represents the gravity weight based on current animations being played. Unity's Animator.gravityWeight Documentation

    hasBoundPlayables

    boolean
    ClientOnly
    ReadOnly

    Indicates whether any playable graphs are attached to the Animator. Unity's Animator.hasBoundPlayables Documentation

    hasRootMotion

    boolean
    ClientOnly
    ReadOnly

    Determines if the Animator's animation data contains root motion. Unity's Animator.hasRootMotion Documentation

    hasTransformHierarchy

    boolean
    ClientOnly
    ReadOnly

    Indicates if the Animator has a transform hierarchy. Unity's Animator.hasTransformHierarchy Documentation

    humanScale

    number
    ClientOnly
    ReadOnly

    Provides the scale of the humanoid Avatar in meters. Unity's Animator.humanScale Documentation

    isHuman

    boolean
    ClientOnly
    ReadOnly

    Checks if the Animator controls a humanoid model. Unity's Animator.isHuman Documentation

    isInitialized

    boolean
    ClientOnly
    ReadOnly

    Checks if the Animator is initialized and ready to control animations. Unity's Animator.isInitialized Documentation

    isMatchingTarget

    boolean
    ClientOnly
    ReadOnly

    Indicates whether the character is currently matching a target via script. Unity's Animator.isMatchingTarget Documentation

    isOptimizable

    boolean
    ClientOnly
    ReadOnly

    Indicates if the Animator can be optimized for performance. Unity's Animator.isOptimizable Documentation

    Keeps the current Animator state and its time when the GameObject is disabled. Unity's Animator.keepAnimatorStateOnDisable Documentation

    layerCount

    number
    ClientOnly
    ReadOnly

    Represents the total number of layers within the Animator. Unity's Animator.layerCount Documentation

    layersAffectMassCenter

    boolean
    ClientOnly

    Controls whether the mass center is affected by all layers or only the base layer. Unity's Animator.layersAffectMassCenter Documentation

    leftFeetBottomHeight

    number
    ClientOnly
    ReadOnly

    Provides the position of the bottom of the left foot relative to the root. Unity's Animator.leftFeetBottomHeight Documentation

    logWarnings

    boolean
    ClientOnly

    Controls whether warnings are logged for issues with AnimatorController setup. Unity's Animator.logWarnings Documentation

    parameterCount

    number
    ClientOnly
    ReadOnly

    Pertains to the count of parameters in the Animator Controller. Unity's Animator.parameterCount Documentation

    pivotPosition

    ClientOnly
    ReadOnly

    Offers the current position of the pivot in the avatar root, relative to world space. Unity's Animator.pivotPosition Documentation

    pivotWeight

    number
    ClientOnly
    ReadOnly

    Indicates the current weight of the pivot, as determined by foot animations. Unity's Animator.pivotWeight Documentation

    playbackTime

    number
    ClientOnly

    Gets the current playback time of the Animator recorder. Unity's Animator.playbackTime Documentation

    recorderStartTime

    number
    ClientOnly

    Represents the start time of the first frame of the Animator recorder. Unity's Animator.recorderStartTime Documentation

    recorderStopTime

    number
    ClientOnly

    Provides the stop time of the last frame of the Animator recorder. Unity's Animator.recorderStopTime Documentation

    rightFeetBottomHeight

    number
    ClientOnly
    ReadOnly

    Represents the position of the bottom of the right foot relative to the root. Unity's Animator.rightFeetBottomHeight Documentation

    Provides the position of the root of the GameObject controlled by the Animator. Unity's Animator.rootPosition Documentation

    Offers the rotation of the root of the GameObject controlled by the Animator. Unity's Animator.rootRotation Documentation

    speed

    number
    ClientOnly

    Allows manipulation of the Animator's playback speed. Unity's Animator.speed Documentation

    stabilizeFeet

    boolean
    ClientOnly

    Controls feet stabilization for plant and IK feet. Unity's Animator.stabilizeFeet Documentation

    targetPosition

    ClientOnly
    ReadOnly

    Gets the target position for the MatchTarget function. Unity's Animator.targetPosition Documentation

    targetRotation

    ClientOnly
    ReadOnly

    Fetches the target rotation for the MatchTarget function. Unity's Animator.targetRotation Documentation

    velocity

    ClientOnly
    ReadOnly

    Gives the velocity vector of the GameObject controlled by the Animator. Unity's Animator.velocity Documentation

    Writes default values into the GameObject when the animator component is disabled. Unity's Animator.writeDefaultValuesOnDisable Documentation

    Methods

    Applies built-in root motion from animation clips, if present. Unity's Animator.ApplyBuiltinRootMotion Documentation

    Returns

    void

    CrossFade

    ClientOnly

    Transitions from the current state to another over a relative duration. Unity's Animator.CrossFade Documentation

    Parameters

    stateHashName
    number
    normalizedTransitionDuration
    number

    Duration of the transition relative to animation length.

    Returns

    void

    CrossFade

    ClientOnly

    Transitions from the current state to another over a relative duration. Unity's Animator.CrossFade Documentation

    Parameters

    stateHashName
    number
    normalizedTransitionDuration
    number

    Duration of the transition relative to animation length.

    layer
    number

    Index of the layer.

    Returns

    void

    CrossFade

    ClientOnly

    Transitions from the current state to another over a relative duration. Unity's Animator.CrossFade Documentation

    Parameters

    stateHashName
    number
    normalizedTransitionDuration
    number

    Duration of the transition relative to animation length.

    layer
    number

    Index of the layer.

    normalizedTimeOffset
    number

    Adjusts the starting point of the transition.

    Returns

    void

    CrossFade

    ClientOnly

    Transitions from the current state to another over a relative duration. Unity's Animator.CrossFade Documentation

    Parameters

    stateHashName
    number
    normalizedTransitionDuration
    number

    Duration of the transition relative to animation length.

    layer
    number

    Index of the layer.

    normalizedTimeOffset
    number

    Adjusts the starting point of the transition.

    normalizedTransitionTime
    number

    Returns

    void

    CrossFade

    ClientOnly

    Transitions from the current state to another over a relative duration. Unity's Animator.CrossFade Documentation

    Parameters

    stateName
    string

    The name of the state.

    normalizedTransitionDuration
    number

    Duration of the transition relative to animation length.

    Returns

    void

    CrossFade

    ClientOnly

    Transitions from the current state to another over a relative duration. Unity's Animator.CrossFade Documentation

    Parameters

    stateName
    string

    The name of the state.

    normalizedTransitionDuration
    number

    Duration of the transition relative to animation length.

    layer
    number

    Index of the layer.

    Returns

    void

    CrossFade

    ClientOnly

    Transitions from the current state to another over a relative duration. Unity's Animator.CrossFade Documentation

    Parameters

    stateName
    string

    The name of the state.

    normalizedTransitionDuration
    number

    Duration of the transition relative to animation length.

    layer
    number

    Index of the layer.

    normalizedTimeOffset
    number

    Adjusts the starting point of the transition.

    Returns

    void

    CrossFade

    ClientOnly

    Transitions from the current state to another over a relative duration. Unity's Animator.CrossFade Documentation

    Parameters

    stateName
    string

    The name of the state.

    normalizedTransitionDuration
    number

    Duration of the transition relative to animation length.

    layer
    number

    Index of the layer.

    normalizedTimeOffset
    number

    Adjusts the starting point of the transition.

    normalizedTransitionTime
    number

    Returns

    void

    Gradually blends from the current animation to another over a fixed time. Unity's Animator.CrossFadeInFixedTime Documentation

    Parameters

    stateHashName
    number
    fixedTransitionDuration
    number

    The duration of the transition.

    Returns

    void

    Gradually blends from the current animation to another over a fixed time. Unity's Animator.CrossFadeInFixedTime Documentation

    Parameters

    stateHashName
    number
    fixedTransitionDuration
    number

    The duration of the transition.

    layer
    number

    Returns

    void

    Gradually blends from the current animation to another over a fixed time. Unity's Animator.CrossFadeInFixedTime Documentation

    Parameters

    stateHashName
    number
    fixedTransitionDuration
    number

    The duration of the transition.

    layer
    number
    fixedTimeOffset
    number

    Returns

    void

    Gradually blends from the current animation to another over a fixed time. Unity's Animator.CrossFadeInFixedTime Documentation

    Parameters

    stateHashName
    number
    fixedTransitionDuration
    number

    The duration of the transition.

    layer
    number
    fixedTimeOffset
    number
    normalizedTransitionTime
    number

    Returns

    void

    Gradually blends from the current animation to another over a fixed time. Unity's Animator.CrossFadeInFixedTime Documentation

    Parameters

    stateName
    string

    The name of the state to transition to.

    fixedTransitionDuration
    number

    The duration of the transition.

    Returns

    void

    Gradually blends from the current animation to another over a fixed time. Unity's Animator.CrossFadeInFixedTime Documentation

    Parameters

    stateName
    string

    The name of the state to transition to.

    fixedTransitionDuration
    number

    The duration of the transition.

    layer
    number

    Returns

    void

    Gradually blends from the current animation to another over a fixed time. Unity's Animator.CrossFadeInFixedTime Documentation

    Parameters

    stateName
    string

    The name of the state to transition to.

    fixedTransitionDuration
    number

    The duration of the transition.

    layer
    number
    fixedTimeOffset
    number

    Returns

    void

    Gradually blends from the current animation to another over a fixed time. Unity's Animator.CrossFadeInFixedTime Documentation

    Parameters

    stateName
    string

    The name of the state to transition to.

    fixedTransitionDuration
    number

    The duration of the transition.

    layer
    number
    fixedTimeOffset
    number
    normalizedTransitionTime
    number

    Returns

    void

    GetBool

    ClientOnly

    Retrieves the value of a boolean parameter in the Animator. Unity's Animator.GetBool Documentation

    Parameters

    id
    number

    Returns

    boolean

    The current state (true or false) of the specified parameter.

    GetBool

    ClientOnly

    Retrieves the value of a boolean parameter in the Animator. Unity's Animator.GetBool Documentation

    Parameters

    name
    string

    Name of the parameter.

    Returns

    boolean

    The current state (true or false) of the specified parameter.

    Returns the count of AnimatorClipInfo instances for the current layer. Unity's Animator.GetCurrentAnimatorClipInfoCount Documentation

    Parameters

    layerIndex
    number

    The index of the layer.

    Returns

    number

    The count of AnimatorClipInfo instances.

    GetFloat

    ClientOnly

    Retrieves a float parameter from the Animator. Unity's Animator.GetFloat Documentation

    Parameters

    id
    number

    Returns

    number

    The float value of the specified parameter.

    GetFloat

    ClientOnly

    Retrieves a float parameter from the Animator. Unity's Animator.GetFloat Documentation

    Parameters

    name
    string

    The name of the parameter to retrieve.

    Returns

    number

    The float value of the specified parameter.

    GetInteger

    ClientOnly

    Fetches the value of an integer parameter in the Animator. Unity's Animator.GetInteger Documentation

    Parameters

    id
    number

    Returns

    number

    The current state of the specified parameter.

    GetInteger

    ClientOnly

    Fetches the value of an integer parameter in the Animator. Unity's Animator.GetInteger Documentation

    Parameters

    name
    string

    Name of the parameter.

    Returns

    number

    The current state of the specified parameter.

    GetLayerIndex

    ClientOnly

    Finds the index of a layer by its name. Unity's Animator.GetLayerIndex Documentation

    Parameters

    layerName
    string

    The name of the layer.

    Returns

    number

    The index of the layer.

    GetLayerName

    ClientOnly

    Retrieves the name of a layer by its index. Unity's Animator.GetLayerName Documentation

    Parameters

    layerIndex
    number

    The index of the layer.

    Returns

    string

    The name of the layer.

    GetLayerWeight

    ClientOnly

    Gets the weight of a layer, defining its influence on the final animation. Unity's Animator.GetLayerWeight Documentation

    Parameters

    layerIndex
    number

    The index of the layer.

    Returns

    number

    The weight of the layer.

    Gets the count of AnimatorClipInfo for the next layer the animator will transition to. Unity's Animator.GetNextAnimatorClipInfoCount Documentation

    Parameters

    layerIndex
    number

    The index of the layer.

    Returns

    number

    The count of AnimatorClipInfo instances for the next layer.

    HasState

    ClientOnly

    Checks if a specific state exists within a layer of the Animator. Unity's Animator.HasState Documentation

    Parameters

    layerIndex
    number

    The index of the layer.

    stateID
    number

    The ID of the state to check for existence.

    Returns

    boolean

    True if the state exists in the specified layer, false otherwise.

    Interrupts automatic target matching, allowing manual control. Unity's Animator.InterruptMatchTarget Documentation

    Returns

    void

    Interrupts automatic target matching, allowing manual control. Unity's Animator.InterruptMatchTarget Documentation

    Parameters

    completeMatch
    boolean

    Returns

    void

    IsInTransition

    ClientOnly

    Checks if the animator is in a transition between animations in the state machine. Unity's Animator.IsInTransition Documentation

    Parameters

    layerIndex
    number

    The index of the layer.

    Returns

    boolean

    True if the animator is in transition, false otherwise.

    Checks if a parameter is controlled by a curve. Unity's Animator.IsParameterControlledByCurve Documentation

    Parameters

    id
    number

    Returns

    boolean

    True if the parameter is controlled by a curve, false otherwise.

    Checks if a parameter is controlled by a curve. Unity's Animator.IsParameterControlledByCurve Documentation

    Parameters

    name
    string

    The name of the parameter to check.

    Returns

    boolean

    True if the parameter is controlled by a curve, false otherwise.

    Play

    ClientOnly

    Plays an animation state, allowing direct control over animation playback. Unity's Animator.Play Documentation

    Parameters

    stateNameHash
    number

    Returns

    void

    Play

    ClientOnly

    Plays an animation state, allowing direct control over animation playback. Unity's Animator.Play Documentation

    Parameters

    stateNameHash
    number
    layer
    number

    The layer index.

    Returns

    void

    Play

    ClientOnly

    Plays an animation state, allowing direct control over animation playback. Unity's Animator.Play Documentation

    Parameters

    stateNameHash
    number
    layer
    number

    The layer index.

    normalizedTime
    number

    Returns

    void

    Play

    ClientOnly

    Plays an animation state, allowing direct control over animation playback. Unity's Animator.Play Documentation

    Parameters

    stateName
    string

    The name of the state.

    Returns

    void

    Play

    ClientOnly

    Plays an animation state, allowing direct control over animation playback. Unity's Animator.Play Documentation

    Parameters

    stateName
    string

    The name of the state.

    layer
    number

    The layer index.

    Returns

    void

    Play

    ClientOnly

    Plays an animation state, allowing direct control over animation playback. Unity's Animator.Play Documentation

    Parameters

    stateName
    string

    The name of the state.

    layer
    number

    The layer index.

    normalizedTime
    number

    Returns

    void

    PlayInFixedTime

    ClientOnly

    Plays an animation state at a specified time scale, unaffected by Animator speed. Unity's Animator.PlayInFixedTime Documentation

    Parameters

    stateNameHash
    number

    Returns

    void

    PlayInFixedTime

    ClientOnly

    Plays an animation state at a specified time scale, unaffected by Animator speed. Unity's Animator.PlayInFixedTime Documentation

    Parameters

    stateNameHash
    number
    layer
    number

    The layer index.

    Returns

    void

    PlayInFixedTime

    ClientOnly

    Plays an animation state at a specified time scale, unaffected by Animator speed. Unity's Animator.PlayInFixedTime Documentation

    Parameters

    stateNameHash
    number
    layer
    number

    The layer index.

    fixedTime
    number

    Returns

    void

    PlayInFixedTime

    ClientOnly

    Plays an animation state at a specified time scale, unaffected by Animator speed. Unity's Animator.PlayInFixedTime Documentation

    Parameters

    stateName
    string

    The name of the state to play.

    Returns

    void

    PlayInFixedTime

    ClientOnly

    Plays an animation state at a specified time scale, unaffected by Animator speed. Unity's Animator.PlayInFixedTime Documentation

    Parameters

    stateName
    string

    The name of the state to play.

    layer
    number

    The layer index.

    Returns

    void

    PlayInFixedTime

    ClientOnly

    Plays an animation state at a specified time scale, unaffected by Animator speed. Unity's Animator.PlayInFixedTime Documentation

    Parameters

    stateName
    string

    The name of the state to play.

    layer
    number

    The layer index.

    fixedTime
    number

    Returns

    void

    Rebind

    ClientOnly

    Resets the Animator to its default state, removing all runtime modifications. Unity's Animator.Rebind Documentation

    Returns

    void

    ResetTrigger

    ClientOnly

    Clears a trigger parameter. Unity's Animator.ResetTrigger Documentation

    Parameters

    id
    number

    Returns

    void

    ResetTrigger

    ClientOnly

    Clears a trigger parameter. Unity's Animator.ResetTrigger Documentation

    Parameters

    name
    string

    Name of the trigger parameter to reset.

    Returns

    void

    SetBool

    ClientOnly

    Sets the value of a boolean parameter in the Animator. Unity's Animator.SetBool Documentation

    Parameters

    id
    number
    value
    boolean

    The value to be set.

    Returns

    void

    SetBool

    ClientOnly

    Sets the value of a boolean parameter in the Animator. Unity's Animator.SetBool Documentation

    Parameters

    name
    string

    Name of the parameter.

    value
    boolean

    The value to be set.

    Returns

    void

    SetFloat

    ClientOnly

    Sets the value of a float parameter. Unity's Animator.SetFloat Documentation

    Parameters

    id
    number
    value
    number

    The value to be set.

    Returns

    void

    SetFloat

    ClientOnly

    Sets the value of a float parameter. Unity's Animator.SetFloat Documentation

    Parameters

    id
    number
    value
    number

    The value to be set.

    dampTime
    number
    deltaTime
    number

    Returns

    void

    SetFloat

    ClientOnly

    Sets the value of a float parameter. Unity's Animator.SetFloat Documentation

    Parameters

    name
    string

    Name of the parameter.

    value
    number

    The value to be set.

    Returns

    void

    SetFloat

    ClientOnly

    Sets the value of a float parameter. Unity's Animator.SetFloat Documentation

    Parameters

    name
    string

    Name of the parameter.

    value
    number

    The value to be set.

    dampTime
    number
    deltaTime
    number

    Returns

    void

    SetInteger

    ClientOnly

    Assigns an integer value to an integer parameter in the Animator. Unity's Animator.SetInteger Documentation

    Parameters

    id
    number
    value
    number

    The value to be set.

    Returns

    void

    SetInteger

    ClientOnly

    Assigns an integer value to an integer parameter in the Animator. Unity's Animator.SetInteger Documentation

    Parameters

    name
    string

    Name of the parameter.

    value
    number

    The value to be set.

    Returns

    void

    SetLayerWeight

    ClientOnly

    Sets the weight of a layer, adjusting its influence on the final animation outcome. Unity's Animator.SetLayerWeight Documentation

    Parameters

    layerIndex
    number

    The index of the layer.

    weight
    number

    The weight to set for the layer.

    Returns

    void

    Sets a target position for the character's head to look at. Unity's Animator.SetLookAtPosition Documentation

    Parameters

    lookAtPosition

    Position for the character to look at.

    Returns

    void

    SetLookAtWeight

    ClientOnly

    Sets the weights for the head and body parts to look at a position. Unity's Animator.SetLookAtWeight Documentation

    Parameters

    weight
    number

    The weight by which the body parts follow the lookAtPosition.

    Returns

    void

    SetLookAtWeight

    ClientOnly

    Sets the weights for the head and body parts to look at a position. Unity's Animator.SetLookAtWeight Documentation

    Parameters

    weight
    number

    The weight by which the body parts follow the lookAtPosition.

    bodyWeight
    number

    Returns

    void

    SetLookAtWeight

    ClientOnly

    Sets the weights for the head and body parts to look at a position. Unity's Animator.SetLookAtWeight Documentation

    Parameters

    weight
    number

    The weight by which the body parts follow the lookAtPosition.

    bodyWeight
    number
    headWeight
    number

    Returns

    void

    SetLookAtWeight

    ClientOnly

    Sets the weights for the head and body parts to look at a position. Unity's Animator.SetLookAtWeight Documentation

    Parameters

    weight
    number

    The weight by which the body parts follow the lookAtPosition.

    bodyWeight
    number
    headWeight
    number
    eyesWeight
    number

    Returns

    void

    SetLookAtWeight

    ClientOnly

    Sets the weights for the head and body parts to look at a position. Unity's Animator.SetLookAtWeight Documentation

    Parameters

    weight
    number

    The weight by which the body parts follow the lookAtPosition.

    bodyWeight
    number
    headWeight
    number
    eyesWeight
    number
    clampWeight
    number

    Returns

    void

    SetTrigger

    ClientOnly

    Activates a trigger parameter to change the animator's state. Unity's Animator.SetTrigger Documentation

    Parameters

    id
    number

    Returns

    void

    SetTrigger

    ClientOnly

    Activates a trigger parameter to change the animator's state. Unity's Animator.SetTrigger Documentation

    Parameters

    name
    string

    Name of the trigger parameter.

    Returns

    void

    StartPlayback

    ClientOnly

    Begins animator playback mode, useful for testing Animator functionality. Unity's Animator.StartPlayback Documentation

    Returns

    void

    StartRecording

    ClientOnly

    Starts recording the Animator in play mode for analysis or replaying sequences. Unity's Animator.StartRecording Documentation

    Parameters

    frameCount
    number

    Number of frames to record.

    Returns

    void

    StopPlayback

    ClientOnly

    Stops animator playback mode initiated by StartPlayback. Unity's Animator.StopPlayback Documentation

    Returns

    void

    StopRecording

    ClientOnly

    Stops recording started by StartRecording, controlling recording duration. Unity's Animator.StopRecording Documentation

    Returns

    void

    StringToHash

    ClientOnly

    Converts a string into a hash ID for efficient parameter identification. Unity's Animator.StringToHash Documentation

    Parameters

    name
    string

    The string to convert into a hash ID.

    Returns

    number

    The hash ID of the string.

    Update

    ClientOnly

    Manually advances the Animator state machine by a specified amount of time. Unity's Animator.Update Documentation

    Parameters

    deltaTime
    number

    The amount of time to advance the state machine.

    Returns

    void

    Writes default values to the Animator, resetting runtime modifications. Unity's Animator.WriteDefaultValues Documentation

    Returns

    void

    Updated 4 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.