Animator
class in UnityEngine · UnityEngine.AnimationModule · inherits from Behaviour
Runs a controller's state machines on its GameObject. Once per frame, after Update and coroutines (in FixedUpdate with AnimatePhysics), as Unity's conformance trace shows: a cross-fade that reached its end completes, the current state's time advances (and the next state's and the cross-fade's), then, outside cross-fades, one transition may fire (Any State first). Zero-length transitions switch at once; exit-time transitions carry the time past the exit into the next state. Play applies at the next update without advancing it. Properties a state doesn't animate go back to the values they had when the Animator bound (write defaults).
Constructors 1
Animator()Properties 24
Vector3 angularVelocity { get; }bool applyRootMotion { get; set; }Avatar? avatar { get; set; }AnimatorCullingMode cullingMode { get; set; }Vector3 deltaPosition { get; }How far root motion moved the GameObject last update (world space).
Quaternion deltaRotation { get; }bool fireEvents { get; set; }bool hasBoundPlayables { get; }bool hasRootMotion { get; }bool isHuman { get; }bool isInitialized { get; }bool keepAnimatorStateOnDisable { get; set; }int layerCount { get; }bool logWarnings { get; set; }int parameterCount { get; }AnimatorControllerParameter[] parameters { get; }Vector3 rootPosition { get; set; }Quaternion rootRotation { get; set; }RuntimeAnimatorController? runtimeAnimatorController { get; set; }float speed { get; set; }bool stabilizeFeet { get; set; }AnimatorUpdateMode updateMode { get; set; }Vector3 velocity { get; }bool writeDefaultValuesOnDisable { get; set; }Methods 33
void ApplyBuiltinRootMotion()Applies the last update's root motion (for OnAnimatorMove handlers).
void CrossFade(string stateName, float normalizedTransitionDuration, int layer = -1, float normalizedTimeOffset = float.NegativeInfinity)void CrossFade(string stateName, float normalizedTransitionDuration, int layer)void CrossFade(string stateName, float normalizedTransitionDuration)void CrossFade(int stateHashName, float normalizedTransitionDuration, int layer = -1, float normalizedTimeOffset = float.NegativeInfinity)void CrossFade(int stateHashName, float normalizedTransitionDuration, int layer)void CrossFade(int stateHashName, float normalizedTransitionDuration)void CrossFadeInFixedTime(string stateName, float fixedTransitionDuration, int layer = -1, float fixedTimeOffset = 0f)void CrossFadeInFixedTime(string stateName, float fixedTransitionDuration)void CrossFadeInFixedTime(string stateName, float fixedTransitionDuration, int layer)void CrossFadeInFixedTime(int stateHashName, float fixedTransitionDuration, int layer = -1, float fixedTimeOffset = 0f)void CrossFadeInFixedTime(int stateHashName, float fixedTransitionDuration, int layer)void CrossFadeInFixedTime(int stateHashName, float fixedTransitionDuration)AnimatorTransitionInfo GetAnimatorTransitionInfo(int layerIndex)T? GetBehaviour<T>()T[] GetBehaviours<T>()bool GetBool(string name)bool GetBool(int id)AnimatorClipInfo[] GetCurrentAnimatorClipInfo(int layerIndex)int GetCurrentAnimatorClipInfoCount(int layerIndex)AnimatorStateInfo GetCurrentAnimatorStateInfo(int layerIndex)float GetFloat(string name)float GetFloat(int id)int GetInteger(string name)int GetInteger(int id)int GetLayerIndex(string layerName)string GetLayerName(int layerIndex)float GetLayerWeight(int layerIndex)AnimatorClipInfo[] GetNextAnimatorClipInfo(int layerIndex)AnimatorStateInfo GetNextAnimatorStateInfo(int layerIndex)AnimatorControllerParameter GetParameter(int index)bool HasState(int layerIndex, int stateID)bool IsInTransition(int layerIndex)bool IsParameterControlledByCurve(string name)bool IsParameterControlledByCurve(int id)void Play(string stateName, int layer = -1, float normalizedTime = float.NegativeInfinity)void Play(string stateName, int layer)void Play(string stateName)void Play(int stateNameHash, int layer = -1, float normalizedTime = float.NegativeInfinity)void Play(int stateNameHash, int layer)void Play(int stateNameHash)void PlayInFixedTime(string stateName, int layer = -1, float fixedTime = float.NegativeInfinity)void PlayInFixedTime(string stateName, int layer)void PlayInFixedTime(string stateName)void PlayInFixedTime(int stateNameHash, int layer = -1, float fixedTime = float.NegativeInfinity)void PlayInFixedTime(int stateNameHash, int layer)void PlayInFixedTime(int stateNameHash)void Rebind()void ResetTrigger(string name)void ResetTrigger(int id)void SetBool(string name, bool value)void SetBool(int id, bool value)void SetFloat(string name, float value)void SetFloat(int id, float value)void SetFloat(string name, float value, float dampTime, float deltaTime)void SetFloat(int id, float value, float dampTime, float deltaTime)void SetInteger(string name, int value)void SetInteger(int id, int value)void SetLayerWeight(int layerIndex, float weight)void SetTrigger(string name)void SetTrigger(int id)static int StringToHash(string name)Unity's hash of state, parameter and tag names: CRC-32 of the UTF-8 text.
void Update(float deltaTime)void WriteDefaultValues()Not in Tassix yet 47
GetBoneTransform GetIKHintPosition GetIKHintPositionWeight GetIKPosition GetIKPositionWeight GetIKRotation GetIKRotationWeight GetNextAnimatorClipInfoCount InterruptMatchTarget MatchTarget ResetControllerState SetBoneLocalRotation SetIKHintPosition SetIKHintPositionWeight SetIKPosition SetIKPositionWeight SetIKRotation SetIKRotationWeight SetLookAtPosition SetLookAtWeight SetTarget StartPlayback StartRecording StopPlayback StopRecording animatePhysics avatarRoot bodyPosition bodyRotation feetPivotActive gravityWeight hasTransformHierarchy humanScale isMatchingTarget isOptimizable layersAffectMassCenter leftFeetBottomHeight pivotPosition pivotWeight playableGraph playbackTime recorderMode recorderStartTime recorderStopTime rightFeetBottomHeight targetPosition targetRotation
Checked against Unity
Conformance scenarios that exercise it, recorded in Unity and compared event by event.