Skip to content

Animator

Controls animation state machines and blend trees on a GameObject. In VRChat worlds, Animators drive doors opening, buttons pressing, environment changes, and any visual state transitions.

Properties

PropertyTypeAccess
angularVelocityVector3get
applyRootMotionboolget, set
avatarUnityEngineAvatarget, set
avatarRootTransformget
bodyPositionVector3get, set
bodyRotationQuaternionget, set
cullingModeUnityEngineAnimatorCullingModeget, set
deltaPositionVector3get
deltaRotationQuaternionget
enabledboolget, set
feetPivotActivefloatget, set
gameObjectGameObjectget
gravityWeightfloatget
hasRootMotionboolget
hasTransformHierarchyboolget
humanScalefloatget
isHumanboolget
isInitializedboolget
isMatchingTargetboolget
isOptimizableboolget
keepAnimatorControllerStateOnDisableboolget, set
keepAnimatorStateOnDisableboolget, set
layerCountintget
layersAffectMassCenterboolget, set
leftFeetBottomHeightfloatget
logWarningsboolget, set
namestringget, set
parameterCountintget
parametersUnityEngineAnimatorControllerParameter[]get
pivotPositionVector3get
pivotWeightfloatget
playbackTimefloatget, set
recorderModeUnityEngineAnimatorRecorderModeget
recorderStartTimefloatget, set
recorderStopTimefloatget, set
rightFeetBottomHeightfloatget
rootPositionVector3get, set
rootRotationQuaternionget, set
runtimeAnimatorControllerUnityEngineRuntimeAnimatorControllerget, set
speedfloatget, set
stabilizeFeetboolget, set
targetPositionVector3get
targetRotationQuaternionget
transformTransformget
updateModeUnityEngineAnimatorUpdateModeget, set
velocityVector3get
writeDefaultValuesOnDisableboolget, set

enabled

Whether this Animator component is active.

animator.enabled = true

speed

Global playback speed multiplier for all animations on this Animator.

animator.speed = 0.5

Methods

ApplyBuiltinRootMotion

ApplyBuiltinRootMotion() -> void

CrossFade

CrossFade(stateHashName: int, normalizedTransitionDuration: float, layer: int, normalizedTimeOffset: float, normalizedTransitionTime: float) -> void
CrossFade(stateHashName: int, normalizedTransitionDuration: float, layer: int, normalizedTimeOffset: float) -> void
CrossFade(stateHashName: int, normalizedTransitionDuration: float, layer: int) -> void
CrossFade(stateHashName: int, normalizedTransitionDuration: float) -> void
CrossFade(stateName: string, normalizedTransitionDuration: float, layer: int, normalizedTimeOffset: float, normalizedTransitionTime: float) -> void
CrossFade(stateName: string, normalizedTransitionDuration: float, layer: int, normalizedTimeOffset: float) -> void
CrossFade(stateName: string, normalizedTransitionDuration: float, layer: int) -> void
CrossFade(stateName: string, normalizedTransitionDuration: float) -> void

Smoothly transitions to an animation state over a given duration in seconds.

animator.CrossFade("Walk", 0.25)

CrossFadeInFixedTime

CrossFadeInFixedTime(stateHashName: int, fixedTransitionDuration: float, layer: int, fixedTimeOffset: float, normalizedTransitionTime: float) -> void
CrossFadeInFixedTime(stateHashName: int, fixedTransitionDuration: float, layer: int, fixedTimeOffset: float) -> void
CrossFadeInFixedTime(stateHashName: int, fixedTransitionDuration: float, layer: int) -> void
CrossFadeInFixedTime(stateHashName: int, fixedTransitionDuration: float) -> void
CrossFadeInFixedTime(stateName: string, fixedTransitionDuration: float, layer: int, fixedTimeOffset: float, normalizedTransitionTime: float) -> void
CrossFadeInFixedTime(stateName: string, fixedTransitionDuration: float, layer: int, fixedTimeOffset: float) -> void
CrossFadeInFixedTime(stateName: string, fixedTransitionDuration: float, layer: int) -> void
CrossFadeInFixedTime(stateName: string, fixedTransitionDuration: float) -> void

Equals

Equals(other: object) -> bool

GetAnimatorTransitionInfo

GetAnimatorTransitionInfo(layerIndex: int) -> UnityEngineAnimatorTransitionInfo

GetBoneTransform

GetBoneTransform(humanBoneId: UnityEngineHumanBodyBones) -> Transform

GetBool

GetBool(id: int) -> bool
GetBool(name: string) -> bool

Returns the current value of a boolean Animator parameter.

let open: bool = animator.GetBool("isOpen")

GetComponent

GetComponent(type: string) -> UnityEngineComponent
GetComponent(type: SystemType) -> UnityEngineComponent
GetComponent(type: SystemType) -> UnityEngineObject

GetComponentInChildren

GetComponentInChildren(includeInactive: bool, type: SystemType) -> UnityEngineObject
GetComponentInChildren(t: SystemType, includeInactive: bool) -> UnityEngineComponent
GetComponentInChildren(t: SystemType) -> UnityEngineComponent
GetComponentInChildren(type: SystemType) -> UnityEngineObject

GetComponentInParent

GetComponentInParent(includeInactive: bool, type: SystemType) -> UnityEngineObject
GetComponentInParent(t: SystemType, includeInactive: bool) -> UnityEngineComponent
GetComponentInParent(t: SystemType) -> UnityEngineComponent
GetComponentInParent(type: SystemType) -> UnityEngineObject

GetComponents

GetComponents(results: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]], type: SystemType) -> void
GetComponents(type: SystemType, results: SystemCollectionsGenericList`1[[UnityEngineComponent, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> void
GetComponents(type: SystemType) -> UnityEngineComponent[]
GetComponents(type: SystemType) -> UnityEngineObject[]

GetComponentsInChildren

GetComponentsInChildren(results: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]], type: SystemType) -> void
GetComponentsInChildren(includeInactive: bool, result: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> void
GetComponentsInChildren(includeInactive: bool, type: SystemType) -> UnityEngineObject[]
GetComponentsInChildren(t: SystemType, includeInactive: bool) -> UnityEngineComponent[]
GetComponentsInChildren(t: SystemType) -> UnityEngineComponent[]
GetComponentsInChildren(type: SystemType) -> UnityEngineObject[]

GetComponentsInParent

GetComponentsInParent(includeInactive: bool, results: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> void
GetComponentsInParent(includeInactive: bool, type: SystemType) -> UnityEngineObject[]
GetComponentsInParent(t: SystemType, includeInactive: bool) -> UnityEngineComponent[]
GetComponentsInParent(t: SystemType) -> UnityEngineComponent[]
GetComponentsInParent(type: SystemType) -> UnityEngineObject[]

GetCurrentAnimatorClipInfo

GetCurrentAnimatorClipInfo(layerIndex: int, clips: SystemCollectionsGenericList`1[[UnityEngineAnimatorClipInfo, UnityEngineAnimationModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> void
GetCurrentAnimatorClipInfo(layerIndex: int) -> UnityEngineAnimatorClipInfo[]

GetCurrentAnimatorClipInfoCount

GetCurrentAnimatorClipInfoCount(layerIndex: int) -> int

GetCurrentAnimatorStateInfo

GetCurrentAnimatorStateInfo(layerIndex: int) -> UnityEngineAnimatorStateInfo

GetFloat

GetFloat(id: int) -> float
GetFloat(name: string) -> float

Returns the current value of a float Animator parameter.

let spd: float = animator.GetFloat("speed")

GetHashCode

GetHashCode() -> int

GetIKHintPosition

GetIKHintPosition(hint: UnityEngineAvatarIKHint) -> Vector3

GetIKHintPositionWeight

GetIKHintPositionWeight(hint: UnityEngineAvatarIKHint) -> float

GetIKPosition

GetIKPosition(goal: UnityEngineAvatarIKGoal) -> Vector3

GetIKPositionWeight

GetIKPositionWeight(goal: UnityEngineAvatarIKGoal) -> float

GetIKRotation

GetIKRotation(goal: UnityEngineAvatarIKGoal) -> Quaternion

GetIKRotationWeight

GetIKRotationWeight(goal: UnityEngineAvatarIKGoal) -> float

GetInstanceID

GetInstanceID() -> int

GetInteger

GetInteger(id: int) -> int
GetInteger(name: string) -> int

Returns the current value of an integer Animator parameter.

let state: int = animator.GetInteger("state")

GetLayerIndex

GetLayerIndex(layerName: string) -> int

GetLayerName

GetLayerName(layerIndex: int) -> string

GetLayerWeight

GetLayerWeight(layerIndex: int) -> float

GetNextAnimatorClipInfo

GetNextAnimatorClipInfo(layerIndex: int, clips: SystemCollectionsGenericList`1[[UnityEngineAnimatorClipInfo, UnityEngineAnimationModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> void
GetNextAnimatorClipInfo(layerIndex: int) -> UnityEngineAnimatorClipInfo[]

GetNextAnimatorClipInfoCount

GetNextAnimatorClipInfoCount(layerIndex: int) -> int

GetNextAnimatorStateInfo

GetNextAnimatorStateInfo(layerIndex: int) -> UnityEngineAnimatorStateInfo

GetParameter

GetParameter(index: int) -> UnityEngineAnimatorControllerParameter

GetType

GetType() -> SystemType

HasState

HasState(layerIndex: int, stateID: int) -> bool

InterruptMatchTarget

InterruptMatchTarget(completeMatch: bool) -> void
InterruptMatchTarget() -> void

IsInTransition

IsInTransition(layerIndex: int) -> bool

IsParameterControlledByCurve

IsParameterControlledByCurve(id: int) -> bool
IsParameterControlledByCurve(name: string) -> bool

MatchTarget

MatchTarget(matchPosition: Vector3, matchRotation: Quaternion, targetBodyPart: UnityEngineAvatarTarget, weightMask: UnityEngineMatchTargetWeightMask, startNormalizedTime: float, targetNormalizedTime: float, completeMatch: bool) -> void
MatchTarget(matchPosition: Vector3, matchRotation: Quaternion, targetBodyPart: UnityEngineAvatarTarget, weightMask: UnityEngineMatchTargetWeightMask, startNormalizedTime: float, targetNormalizedTime: float) -> void
MatchTarget(matchPosition: Vector3, matchRotation: Quaternion, targetBodyPart: UnityEngineAvatarTarget, weightMask: UnityEngineMatchTargetWeightMask, startNormalizedTime: float) -> void

Play

Play(stateNameHash: int, layer: int, normalizedTime: float) -> void
Play(stateNameHash: int, layer: int) -> void
Play(stateNameHash: int) -> void
Play(stateName: string, layer: int, normalizedTime: float) -> void
Play(stateName: string, layer: int) -> void
Play(stateName: string) -> void

Plays an animation state by name immediately.

animator.Play("Idle")

PlayInFixedTime

PlayInFixedTime(stateNameHash: int, layer: int, fixedTime: float) -> void
PlayInFixedTime(stateNameHash: int, layer: int) -> void
PlayInFixedTime(stateNameHash: int) -> void
PlayInFixedTime(stateName: string, layer: int, fixedTime: float) -> void
PlayInFixedTime(stateName: string, layer: int) -> void
PlayInFixedTime(stateName: string) -> void

Rebind

Rebind() -> void

ResetTrigger

ResetTrigger(id: int) -> void
ResetTrigger(name: string) -> void

SetBoneLocalRotation

SetBoneLocalRotation(humanBoneId: UnityEngineHumanBodyBones, rotation: Quaternion) -> void

SetBool

SetBool(id: int, value: bool) -> void
SetBool(name: string, value: bool) -> void

Sets a boolean parameter in the Animator controller by name.

animator.SetBool("isOpen", true)

SetFloat

SetFloat(id: int, value: float, dampTime: float, deltaTime: float) -> void
SetFloat(id: int, value: float) -> void
SetFloat(name: string, value: float, dampTime: float, deltaTime: float) -> void
SetFloat(name: string, value: float) -> void

Sets a float parameter in the Animator controller by name.

animator.SetFloat("speed", 1.5)

SetIKHintPosition

SetIKHintPosition(hint: UnityEngineAvatarIKHint, hintPosition: Vector3) -> void

SetIKHintPositionWeight

SetIKHintPositionWeight(hint: UnityEngineAvatarIKHint, value: float) -> void

SetIKPosition

SetIKPosition(goal: UnityEngineAvatarIKGoal, goalPosition: Vector3) -> void

SetIKPositionWeight

SetIKPositionWeight(goal: UnityEngineAvatarIKGoal, value: float) -> void

SetIKRotation

SetIKRotation(goal: UnityEngineAvatarIKGoal, goalRotation: Quaternion) -> void

SetIKRotationWeight

SetIKRotationWeight(goal: UnityEngineAvatarIKGoal, value: float) -> void

SetInteger

SetInteger(id: int, value: int) -> void
SetInteger(name: string, value: int) -> void

Sets an integer parameter in the Animator controller by name.

animator.SetInteger("state", 2)

SetLayerWeight

SetLayerWeight(layerIndex: int, weight: float) -> void

SetLookAtPosition

SetLookAtPosition(lookAtPosition: Vector3) -> void

SetLookAtWeight

SetLookAtWeight(weight: float, bodyWeight: float, headWeight: float, eyesWeight: float, clampWeight: float) -> void
SetLookAtWeight(weight: float, bodyWeight: float, headWeight: float, eyesWeight: float) -> void
SetLookAtWeight(weight: float, bodyWeight: float, headWeight: float) -> void
SetLookAtWeight(weight: float, bodyWeight: float) -> void
SetLookAtWeight(weight: float) -> void

SetTarget

SetTarget(targetIndex: UnityEngineAvatarTarget, targetNormalizedTime: float) -> void

SetTrigger

SetTrigger(id: int) -> void
SetTrigger(name: string) -> void

Activates a trigger parameter, causing a one-shot transition.

animator.SetTrigger("jump")

StartPlayback

StartPlayback() -> void

StartRecording

StartRecording(frameCount: int) -> void

StopPlayback

StopPlayback() -> void

StopRecording

StopRecording() -> void

StringToHash

static StringToHash(name: string) -> int

ToString

ToString() -> string

Update

Update(deltaTime: float) -> void

WriteDefaultValues

WriteDefaultValues() -> void