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
| Property | Type | Access |
|---|---|---|
| angularVelocity | Vector3 | get |
| applyRootMotion | bool | get, set |
| avatar | UnityEngineAvatar | get, set |
| avatarRoot | Transform | get |
| bodyPosition | Vector3 | get, set |
| bodyRotation | Quaternion | get, set |
| cullingMode | UnityEngineAnimatorCullingMode | get, set |
| deltaPosition | Vector3 | get |
| deltaRotation | Quaternion | get |
| enabled | bool | get, set |
| feetPivotActive | float | get, set |
| gameObject | GameObject | get |
| gravityWeight | float | get |
| hasRootMotion | bool | get |
| hasTransformHierarchy | bool | get |
| humanScale | float | get |
| isHuman | bool | get |
| isInitialized | bool | get |
| isMatchingTarget | bool | get |
| isOptimizable | bool | get |
| keepAnimatorControllerStateOnDisable | bool | get, set |
| keepAnimatorStateOnDisable | bool | get, set |
| layerCount | int | get |
| layersAffectMassCenter | bool | get, set |
| leftFeetBottomHeight | float | get |
| logWarnings | bool | get, set |
| name | string | get, set |
| parameterCount | int | get |
| parameters | UnityEngineAnimatorControllerParameter[] | get |
| pivotPosition | Vector3 | get |
| pivotWeight | float | get |
| playbackTime | float | get, set |
| recorderMode | UnityEngineAnimatorRecorderMode | get |
| recorderStartTime | float | get, set |
| recorderStopTime | float | get, set |
| rightFeetBottomHeight | float | get |
| rootPosition | Vector3 | get, set |
| rootRotation | Quaternion | get, set |
| runtimeAnimatorController | UnityEngineRuntimeAnimatorController | get, set |
| speed | float | get, set |
| stabilizeFeet | bool | get, set |
| targetPosition | Vector3 | get |
| targetRotation | Quaternion | get |
| transform | Transform | get |
| updateMode | UnityEngineAnimatorUpdateMode | get, set |
| velocity | Vector3 | get |
| writeDefaultValuesOnDisable | bool | get, set |
enabled
Whether this Animator component is active.
animator.enabled = truespeed
Global playback speed multiplier for all animations on this Animator.
animator.speed = 0.5Methods
ApplyBuiltinRootMotion
ApplyBuiltinRootMotion() -> voidCrossFade
CrossFade(stateHashName: int, normalizedTransitionDuration: float, layer: int, normalizedTimeOffset: float, normalizedTransitionTime: float) -> voidCrossFade(stateHashName: int, normalizedTransitionDuration: float, layer: int, normalizedTimeOffset: float) -> voidCrossFade(stateHashName: int, normalizedTransitionDuration: float, layer: int) -> voidCrossFade(stateHashName: int, normalizedTransitionDuration: float) -> voidCrossFade(stateName: string, normalizedTransitionDuration: float, layer: int, normalizedTimeOffset: float, normalizedTransitionTime: float) -> voidCrossFade(stateName: string, normalizedTransitionDuration: float, layer: int, normalizedTimeOffset: float) -> voidCrossFade(stateName: string, normalizedTransitionDuration: float, layer: int) -> voidCrossFade(stateName: string, normalizedTransitionDuration: float) -> voidSmoothly 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) -> voidCrossFadeInFixedTime(stateHashName: int, fixedTransitionDuration: float, layer: int, fixedTimeOffset: float) -> voidCrossFadeInFixedTime(stateHashName: int, fixedTransitionDuration: float, layer: int) -> voidCrossFadeInFixedTime(stateHashName: int, fixedTransitionDuration: float) -> voidCrossFadeInFixedTime(stateName: string, fixedTransitionDuration: float, layer: int, fixedTimeOffset: float, normalizedTransitionTime: float) -> voidCrossFadeInFixedTime(stateName: string, fixedTransitionDuration: float, layer: int, fixedTimeOffset: float) -> voidCrossFadeInFixedTime(stateName: string, fixedTransitionDuration: float, layer: int) -> voidCrossFadeInFixedTime(stateName: string, fixedTransitionDuration: float) -> voidEquals
Equals(other: object) -> boolGetAnimatorTransitionInfo
GetAnimatorTransitionInfo(layerIndex: int) -> UnityEngineAnimatorTransitionInfoGetBoneTransform
GetBoneTransform(humanBoneId: UnityEngineHumanBodyBones) -> TransformGetBool
GetBool(id: int) -> boolGetBool(name: string) -> boolReturns the current value of a boolean Animator parameter.
let open: bool = animator.GetBool("isOpen")GetComponent
GetComponent(type: string) -> UnityEngineComponentGetComponent(type: SystemType) -> UnityEngineComponentGetComponent(type: SystemType) -> UnityEngineObjectGetComponentInChildren
GetComponentInChildren(includeInactive: bool, type: SystemType) -> UnityEngineObjectGetComponentInChildren(t: SystemType, includeInactive: bool) -> UnityEngineComponentGetComponentInChildren(t: SystemType) -> UnityEngineComponentGetComponentInChildren(type: SystemType) -> UnityEngineObjectGetComponentInParent
GetComponentInParent(includeInactive: bool, type: SystemType) -> UnityEngineObjectGetComponentInParent(t: SystemType, includeInactive: bool) -> UnityEngineComponentGetComponentInParent(t: SystemType) -> UnityEngineComponentGetComponentInParent(type: SystemType) -> UnityEngineObjectGetComponents
GetComponents(results: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]], type: SystemType) -> voidGetComponents(type: SystemType, results: SystemCollectionsGenericList`1[[UnityEngineComponent, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> voidGetComponents(type: SystemType) -> UnityEngineComponent[]GetComponents(type: SystemType) -> UnityEngineObject[]GetComponentsInChildren
GetComponentsInChildren(results: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]], type: SystemType) -> voidGetComponentsInChildren(includeInactive: bool, result: SystemCollectionsGenericList`1[[UnityEngineObject, UnityEngineCoreModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> voidGetComponentsInChildren(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]]) -> voidGetComponentsInParent(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]]) -> voidGetCurrentAnimatorClipInfo(layerIndex: int) -> UnityEngineAnimatorClipInfo[]GetCurrentAnimatorClipInfoCount
GetCurrentAnimatorClipInfoCount(layerIndex: int) -> intGetCurrentAnimatorStateInfo
GetCurrentAnimatorStateInfo(layerIndex: int) -> UnityEngineAnimatorStateInfoGetFloat
GetFloat(id: int) -> floatGetFloat(name: string) -> floatReturns the current value of a float Animator parameter.
let spd: float = animator.GetFloat("speed")GetHashCode
GetHashCode() -> intGetIKHintPosition
GetIKHintPosition(hint: UnityEngineAvatarIKHint) -> Vector3GetIKHintPositionWeight
GetIKHintPositionWeight(hint: UnityEngineAvatarIKHint) -> floatGetIKPosition
GetIKPosition(goal: UnityEngineAvatarIKGoal) -> Vector3GetIKPositionWeight
GetIKPositionWeight(goal: UnityEngineAvatarIKGoal) -> floatGetIKRotation
GetIKRotation(goal: UnityEngineAvatarIKGoal) -> QuaternionGetIKRotationWeight
GetIKRotationWeight(goal: UnityEngineAvatarIKGoal) -> floatGetInstanceID
GetInstanceID() -> intGetInteger
GetInteger(id: int) -> intGetInteger(name: string) -> intReturns the current value of an integer Animator parameter.
let state: int = animator.GetInteger("state")GetLayerIndex
GetLayerIndex(layerName: string) -> intGetLayerName
GetLayerName(layerIndex: int) -> stringGetLayerWeight
GetLayerWeight(layerIndex: int) -> floatGetNextAnimatorClipInfo
GetNextAnimatorClipInfo(layerIndex: int, clips: SystemCollectionsGenericList`1[[UnityEngineAnimatorClipInfo, UnityEngineAnimationModule, Version=0000, Culture=neutral, PublicKeyToken=null]]) -> voidGetNextAnimatorClipInfo(layerIndex: int) -> UnityEngineAnimatorClipInfo[]GetNextAnimatorClipInfoCount
GetNextAnimatorClipInfoCount(layerIndex: int) -> intGetNextAnimatorStateInfo
GetNextAnimatorStateInfo(layerIndex: int) -> UnityEngineAnimatorStateInfoGetParameter
GetParameter(index: int) -> UnityEngineAnimatorControllerParameterGetType
GetType() -> SystemTypeHasState
HasState(layerIndex: int, stateID: int) -> boolInterruptMatchTarget
InterruptMatchTarget(completeMatch: bool) -> voidInterruptMatchTarget() -> voidIsInTransition
IsInTransition(layerIndex: int) -> boolIsParameterControlledByCurve
IsParameterControlledByCurve(id: int) -> boolIsParameterControlledByCurve(name: string) -> boolMatchTarget
MatchTarget(matchPosition: Vector3, matchRotation: Quaternion, targetBodyPart: UnityEngineAvatarTarget, weightMask: UnityEngineMatchTargetWeightMask, startNormalizedTime: float, targetNormalizedTime: float, completeMatch: bool) -> voidMatchTarget(matchPosition: Vector3, matchRotation: Quaternion, targetBodyPart: UnityEngineAvatarTarget, weightMask: UnityEngineMatchTargetWeightMask, startNormalizedTime: float, targetNormalizedTime: float) -> voidMatchTarget(matchPosition: Vector3, matchRotation: Quaternion, targetBodyPart: UnityEngineAvatarTarget, weightMask: UnityEngineMatchTargetWeightMask, startNormalizedTime: float) -> voidPlay
Play(stateNameHash: int, layer: int, normalizedTime: float) -> voidPlay(stateNameHash: int, layer: int) -> voidPlay(stateNameHash: int) -> voidPlay(stateName: string, layer: int, normalizedTime: float) -> voidPlay(stateName: string, layer: int) -> voidPlay(stateName: string) -> voidPlays an animation state by name immediately.
animator.Play("Idle")PlayInFixedTime
PlayInFixedTime(stateNameHash: int, layer: int, fixedTime: float) -> voidPlayInFixedTime(stateNameHash: int, layer: int) -> voidPlayInFixedTime(stateNameHash: int) -> voidPlayInFixedTime(stateName: string, layer: int, fixedTime: float) -> voidPlayInFixedTime(stateName: string, layer: int) -> voidPlayInFixedTime(stateName: string) -> voidRebind
Rebind() -> voidResetTrigger
ResetTrigger(id: int) -> voidResetTrigger(name: string) -> voidSetBoneLocalRotation
SetBoneLocalRotation(humanBoneId: UnityEngineHumanBodyBones, rotation: Quaternion) -> voidSetBool
SetBool(id: int, value: bool) -> voidSetBool(name: string, value: bool) -> voidSets a boolean parameter in the Animator controller by name.
animator.SetBool("isOpen", true)SetFloat
SetFloat(id: int, value: float, dampTime: float, deltaTime: float) -> voidSetFloat(id: int, value: float) -> voidSetFloat(name: string, value: float, dampTime: float, deltaTime: float) -> voidSetFloat(name: string, value: float) -> voidSets a float parameter in the Animator controller by name.
animator.SetFloat("speed", 1.5)SetIKHintPosition
SetIKHintPosition(hint: UnityEngineAvatarIKHint, hintPosition: Vector3) -> voidSetIKHintPositionWeight
SetIKHintPositionWeight(hint: UnityEngineAvatarIKHint, value: float) -> voidSetIKPosition
SetIKPosition(goal: UnityEngineAvatarIKGoal, goalPosition: Vector3) -> voidSetIKPositionWeight
SetIKPositionWeight(goal: UnityEngineAvatarIKGoal, value: float) -> voidSetIKRotation
SetIKRotation(goal: UnityEngineAvatarIKGoal, goalRotation: Quaternion) -> voidSetIKRotationWeight
SetIKRotationWeight(goal: UnityEngineAvatarIKGoal, value: float) -> voidSetInteger
SetInteger(id: int, value: int) -> voidSetInteger(name: string, value: int) -> voidSets an integer parameter in the Animator controller by name.
animator.SetInteger("state", 2)SetLayerWeight
SetLayerWeight(layerIndex: int, weight: float) -> voidSetLookAtPosition
SetLookAtPosition(lookAtPosition: Vector3) -> voidSetLookAtWeight
SetLookAtWeight(weight: float, bodyWeight: float, headWeight: float, eyesWeight: float, clampWeight: float) -> voidSetLookAtWeight(weight: float, bodyWeight: float, headWeight: float, eyesWeight: float) -> voidSetLookAtWeight(weight: float, bodyWeight: float, headWeight: float) -> voidSetLookAtWeight(weight: float, bodyWeight: float) -> voidSetLookAtWeight(weight: float) -> voidSetTarget
SetTarget(targetIndex: UnityEngineAvatarTarget, targetNormalizedTime: float) -> voidSetTrigger
SetTrigger(id: int) -> voidSetTrigger(name: string) -> voidActivates a trigger parameter, causing a one-shot transition.
animator.SetTrigger("jump")StartPlayback
StartPlayback() -> voidStartRecording
StartRecording(frameCount: int) -> voidStopPlayback
StopPlayback() -> voidStopRecording
StopRecording() -> voidStringToHash
static StringToHash(name: string) -> intToString
ToString() -> stringUpdate
Update(deltaTime: float) -> voidWriteDefaultValues
WriteDefaultValues() -> void