Animator
7/14/25About 6 min
Animator
Info
Animator inherits from [Behaviour](/docs/create/lua/API/Behaviour/index.html)
Interface to control the Mecanim animation system. Unity Animator
Members
Properties
| Name | Description |
|---|---|
Animator.angularVelocity | Gets the avatar angular velocity for the last evaluated frame. |
Animator.applyRootMotion | Should root motion be applied? |
Animator.avatar | Gets/Sets the current Avatar. |
Animator.bodyPosition | The position of the body center of mass. |
Animator.bodyRotation | The rotation of the body center of mass. |
Animator.cullingMode | Controls culling of this Animator component. |
Animator.deltaPosition | Gets the avatar delta position for the last evaluated frame. |
Animator.deltaRotation | Gets the avatar delta rotation for the last evaluated frame. |
Animator.feetPivotActive | Blends pivot point between body center of mass and feet pivot. |
Animator.fireEvents | Sets whether the Animator sends events of type AnimationEvent. |
Animator.gravityWeight | The current gravity weight based on current animations that are played. |
Animator.hasBoundPlayables | Returns true if Animator has any playables assigned to it. |
Animator.hasRootMotion | Returns true if the current rig has root motion. |
Animator.hasTransformHierarchy | Returns true if the object has a transform hierarchy. |
Animator.humanScale | Returns the scale of the current Avatar for a humanoid rig, (1 by default if the rig is generic). |
Animator.isHuman | Returns true if the current rig is humanoid, false if it is generic. |
Animator.isInitialized | Returns whether the animator is initialized successfully. |
Animator.isMatchingTarget | If automatic matching is active. |
Animator.isOptimizable | Returns true if the current rig is optimizable with AnimatorUtility.OptimizeTransformHierarchy. |
Animator.keepAnimatorControllerStateOnDisable | Controls the behaviour of the Animator component when a GameObject is disabled. |
Animator.layerCount | Returns the number of layers in the controller. |
Animator.layersAffectMassCenter | Additional layers affects the center of mass. |
Animator.leftFeetBottomHeight | Get left foot bottom height. |
Animator.parameterCount | Returns the number of parameters in the controller. |
Animator.parameters | The AnimatorControllerParameter list used by the animator. (Read Only) |
Animator.pivotPosition | Get the current position of the pivot. |
Animator.pivotWeight | Gets the pivot weight. |
Animator.playbackTime | Sets the playback position in the recording buffer. |
Animator.rightFeetBottomHeight | Get right foot bottom height. |
Animator.rootPosition | The root position, the position of the game object. |
Animator.rootRotation | The root rotation, the rotation of the game object. |
Animator.runtimeAnimatorController | The runtime representation of AnimatorController that controls the Animator. |
Animator.speed | The playback speed of the Animator. 1 is normal playback speed. |
Animator.stabilizeFeet | Automatic stabilization of feet during transition and blending. |
Animator.targetPosition | Returns the position of the target specified by SetTarget. |
Animator.targetRotation | Returns the rotation of the target specified by SetTarget. |
Animator.updateMode | Specifies the update mode of the Animator. |
Animator.velocity | Gets the avatar velocity for the last evaluated frame. |
Methods
| Name | Description |
|---|---|
Animator.ApplyBuiltinRootMotion() | Apply the default Root Motion. |
Animator.CrossFade(stateName, normalizedTransitionDuration, layer=-1, normalizedTimeOffset=0, normalizedTransitionTime=0) | Creates a crossfade from the current state to any other state using normalized times. |
Animator.CrossFadeInFixedTime(stateName, fixedTransitionDuration, layer=-1, fixedTimeOffset=0, normalizedTransitionTime=0) | Creates a crossfade from the current state to any other state using times in seconds. |
Animator.GetAnimatorTransitionInfo(layerIndex) | Returns an AnimatorTransitionInfo with the informations on the current transition. |
Animator.GetBoneTransform(humanBoneId) | Returns Transform mapped to this human bone id. Returns null if the animator is disabled, if it does not have a human description, or if the bone id is invalid. |
Animator.GetBool(name) | Returns the value of the given boolean parameter. |
Animator.GetCurrentAnimatorClipInfo(layerIndex) | Returns an array of all the AnimatorClipInfo in the current state of the given layer. |
Animator.GetCurrentAnimatorClipInfoCount(layerIndex) | Returns the number of AnimatorClipInfo in the current state. |
Animator.GetCurrentAnimatorStateInfo(layerIndex) | Returns an AnimatorStateInfo with the information on the current state. |
Animator.GetFloat(name) | Returns the value of the given float parameter. |
Animator.GetIKHintPosition(hint) | Gets the position of an IK hint. |
Animator.GetIKHintPositionWeight(hint) | Gets the translative weight of an IK Hint (0 = at the original animation before IK, 1 = at the hint). |
Animator.GetIKPosition(goal) | Gets the position of an IK goal. |
Animator.GetIKPositionWeight(goal) | Gets the translative weight of an IK goal (0 = at the original animation before IK, 1 = at the goal). |
Animator.GetIKRotation(goal) | Gets the rotation of an IK goal. |
Animator.GetIKRotationWeight(goal) | Gets the rotational weight of an IK goal (0 = rotation before IK, 1 = rotation at the IK goal). |
Animator.GetInteger(name) | Returns the value of the given integer parameter. |
Animator.GetLayerIndex(layerName) | Returns the index of the layer with the given name. |
Animator.GetLayerName(layerIndex) | Returns the layer name. |
Animator.GetLayerWeight(layerIndex) | Returns the weight of the layer at the specified index. |
Animator.GetNextAnimatorClipInfo(layerIndex) | Returns an array of all the AnimatorClipInfo in the next state of the given layer. |
Animator.GetNextAnimatorClipInfoCount(layerIndex) | Returns the number of AnimatorClipInfo in the next state. |
Animator.GetNextAnimatorStateInfo(layerIndex) | Returns an AnimatorStateInfo with the information on the next state. |
Animator.GetParameter(index) | Get animator controller parameter. |
Animator.HasState(layerIndex, stateID) | Returns true if the state exists in this layer, false otherwise. |
Animator.InterruptMatchTarget(completeMatch) | Interrupts the automatic target matching. |
Animator.IsInTransition(layerIndex) | Returns true if there is a transition on the given layer, false otherwise. |
Animator.IsParameterControlledByCurve(name) | Returns true if the parameter is controlled by a curve, false otherwise. |
Animator.MatchTarget(matchPosition, matchRotation, targetBodyPart, positionXYZWeight , rotationWeight, startNormalizedTime, targetNormalizedTime, completeMatch=1) | Automatically adjust the GameObject position and rotation. |
Animator.Play(stateName, layer, normalizedTime=-#INF) | Plays a state. |
Animator.PlayInFixedTime(stateName, layer=-1, fixedTime=-#INF) | Plays a state. |
Animator.Rebind() | Rebind all the animated properties and mesh data with the Animator. |
Animator.ResetTrigger(name) | Resets the value of the given trigger parameter. |
Animator.SetBoneLocalRotation(humanBoneId, rotation) | Sets local rotation of a human bone during a IK pass. |
Animator.SetBool(name, value) | Sets the value of the given boolean parameter. |
Animator.SetFloat(name, value) | Send float values to the Animator to affect transitions. |
Animator.SetFloat(name, value, dampTime, deltaTime) | Send float values to the Animator to affect transitions. |
Animator.SetIKHintPosition(hint, hintPosition) | Sets the position of an IK hint. |
Animator.SetIKHintPositionWeight(hint, value) | Sets the translative weight of an IK hint (0 = at the original animation before IK, 1 = at the hint). |
Animator.SetIKPosition(goal, goalPosition) | Sets the position of an IK goal. |
Animator.SetIKPositionWeight(goal, value) | Sets the translative weight of an IK goal (0 = at the original animation before IK, 1 = at the goal). |
Animator.SetIKRotation(goal, goalRotation) | Sets the rotation of an IK goal. |
Animator.SetIKRotationWeight(goal, value) | Sets the rotational weight of an IK goal (0 = rotation before IK, 1 = rotation at the IK goal). |
Animator.SetInteger(name, value) | Sets the value of the given integer parameter. |
Animator.SetLayerWeight(layerIndex, weight) | Sets the weight of the layer at the given index. |
Animator.SetLookAtPosition(lookAtPosition) | Sets the look at position. |
Animator.SetLookAtWeight(weight, bodyWeight=0, headWeight=1, eyesWeight=0, clampWeight=0.5) | Set look at weights. |
Animator.SetTarget(targetIndex, targetNormalizedTime) | Sets an AvatarTarget and a targetNormalizedTime for the current state. |
Animator.SetTrigger(name) | Sets the value of the given trigger parameter. |
Animator.StartPlayback() | Sets the animator in playback mode. |
Animator.StopPlayback() | Stops the animator playback mode. When playback stops, the avatar resumes getting control from game logic. |
Animator.Update(deltaTime) | Evaluates the animator based on deltaTime. |
Animator.WriteDefaultValues() | Forces a write of the default values stored in the animator. |
Static Methods
| Name | Description |
|---|---|
Animator.StringToHash(name) | Generates an parameter id from a string. |
Inherited Members
Inherited Properties
| Name | Description |
|---|---|
Animator.enabled | Enabled Behaviours are Updated, disabled Behaviours are not. |
Animator.isActiveAndEnabled | Has the Behaviour had active and enabled called? |
Animator.gameObject | The game object this component is attached to. A component is always attached to a game object. |
Animator.tag | The tag of this game object. |
Animator.transform | The Transform attached to this GameObject. |
Animator.hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
Animator.name | The name of the object. |
Inherited Methods
| Name | Description |
|---|---|
Animator.BroadcastMessage(methodName, parameter=nil) | Calls the method named methodName on every Lua Script in this game object or any of its children. |
Animator.CompareTag(tag) | Is this game object tagged with tag ? |
Animator.GetAllLuaScripts() | Returns an array of all Lua scripts that attached to the game object. |
Animator.GetComponent(type) | Returns the component of Type type if the game object has one attached, nil if it doesn't. |
Animator.GetComponentInChildren(t) | Returns the component of Type type in the GameObject or any of its children using depth first search. |
Animator.GetComponentInParent(t) | Returns the component of Type type in the GameObject or any of its parents. |
Animator.GetComponents(type) | Returns all components of Type type in the GameObject. |
Animator.GetComponentsInChildren(t) | Returns all components of Type type in the GameObject or any of its children. |
Animator.GetComponentsInParent(t) | Returns all components of Type type in the GameObject or any of its parents. |
Animator.SendMessage(methodName, value=nil) | Calls the method named methodName on every Lua Script in this game object. |
Animator.SendMessageUpwards(methodName, value=nil) | Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour. |
Animator.TryGetComponent(type) | Gets the component of the specified type, if it exists. |
Animator.GetInstanceID() | Returns the instance id of the object. |

