Skip to content

API > Animator


Animator⚓︎

Animator inherits from Behaviour

Interface to control the Mecanim animation system. Unity Animator

Members⚓︎

Properties⚓︎

Name Description
Animator.angularVelocityProperty Gets the avatar angular velocity for the last evaluated frame.
Animator.applyRootMotionProperty Should root motion be applied?
Animator.avatarProperty Gets/Sets the current Avatar.
Animator.bodyPositionProperty The position of the body center of mass.
Animator.bodyRotationProperty The rotation of the body center of mass.
Animator.cullingModeProperty Controls culling of this Animator component.
Animator.deltaPositionProperty Gets the avatar delta position for the last evaluated frame.
Animator.deltaRotationProperty Gets the avatar delta rotation for the last evaluated frame.
Animator.feetPivotActiveProperty Blends pivot point between body center of mass and feet pivot.
Animator.fireEventsProperty Sets whether the Animator sends events of type AnimationEvent.
Animator.gravityWeightProperty The current gravity weight based on current animations that are played.
Animator.hasBoundPlayablesProperty Returns true if Animator has any playables assigned to it.
Animator.hasRootMotionProperty Returns true if the current rig has root motion.
Animator.hasTransformHierarchyProperty Returns true if the object has a transform hierarchy.
Animator.humanScaleProperty Returns the scale of the current Avatar for a humanoid rig, (1 by default if the rig is generic).
Animator.isHumanProperty Returns true if the current rig is humanoid, false if it is generic.
Animator.isInitializedProperty Returns whether the animator is initialized successfully.
Animator.isMatchingTargetProperty If automatic matching is active.
Animator.isOptimizableProperty Returns true if the current rig is optimizable with AnimatorUtility.OptimizeTransformHierarchy.
Animator.keepAnimatorControllerStateOnDisableProperty Controls the behaviour of the Animator component when a GameObject is disabled.
Animator.layerCountProperty Returns the number of layers in the controller.
Animator.layersAffectMassCenterProperty Additional layers affects the center of mass.
Animator.leftFeetBottomHeightProperty Get left foot bottom height.
Animator.parameterCountProperty Returns the number of parameters in the controller.
Animator.parametersPropertyReadonly Property The AnimatorControllerParameter list used by the animator. (Read Only)
Animator.pivotPositionProperty Get the current position of the pivot.
Animator.pivotWeightProperty Gets the pivot weight.
Animator.playbackTimeProperty Sets the playback position in the recording buffer.
Animator.rightFeetBottomHeightProperty Get right foot bottom height.
Animator.rootPositionProperty The root position, the position of the game object.
Animator.rootRotationProperty The root rotation, the rotation of the game object.
Animator.runtimeAnimatorControllerProperty The runtime representation of AnimatorController that controls the Animator.
Animator.speedProperty The playback speed of the Animator. 1 is normal playback speed.
Animator.stabilizeFeetProperty Automatic stabilization of feet during transition and blending.
Animator.targetPositionProperty Returns the position of the target specified by SetTarget.
Animator.targetRotationProperty Returns the rotation of the target specified by SetTarget.
Animator.updateModeProperty Specifies the update mode of the Animator.
Animator.velocityProperty Gets the avatar velocity for the last evaluated frame.

Methods⚓︎

Name Description
Animator.ApplyBuiltinRootMotion() Method Apply the default Root Motion.
Animator.CrossFade(stateName, normalizedTransitionDuration, layer=-1, normalizedTimeOffset=0, normalizedTransitionTime=0) Method Creates a crossfade from the current state to any other state using normalized times.
Animator.CrossFadeInFixedTime(stateName, fixedTransitionDuration, layer=-1, fixedTimeOffset=0, normalizedTransitionTime=0) Method Creates a crossfade from the current state to any other state using times in seconds.
Animator.GetAnimatorTransitionInfo(layerIndex) Method Returns an AnimatorTransitionInfo with the informations on the current transition.
Animator.GetBoneTransform(humanBoneId) Method 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) Method Returns the value of the given boolean parameter.
Animator.GetCurrentAnimatorClipInfo(layerIndex) Method Returns an array of all the AnimatorClipInfo in the current state of the given layer.
Animator.GetCurrentAnimatorClipInfoCount(layerIndex) Method Returns the number of AnimatorClipInfo in the current state.
Animator.GetCurrentAnimatorStateInfo(layerIndex) Method Returns an AnimatorStateInfo with the information on the current state.
Animator.GetFloat(name) Method Returns the value of the given float parameter.
Animator.GetIKHintPosition(hint) Method Gets the position of an IK hint.
Animator.GetIKHintPositionWeight(hint) Method Gets the translative weight of an IK Hint (0 = at the original animation before IK, 1 = at the hint).
Animator.GetIKPosition(goal) Method Gets the position of an IK goal.
Animator.GetIKPositionWeight(goal) Method Gets the translative weight of an IK goal (0 = at the original animation before IK, 1 = at the goal).
Animator.GetIKRotation(goal) Method Gets the rotation of an IK goal.
Animator.GetIKRotationWeight(goal) Method Gets the rotational weight of an IK goal (0 = rotation before IK, 1 = rotation at the IK goal).
Animator.GetInteger(name) Method Returns the value of the given integer parameter.
Animator.GetLayerIndex(layerName) Method Returns the index of the layer with the given name.
Animator.GetLayerName(layerIndex) Method Returns the layer name.
Animator.GetLayerWeight(layerIndex) Method Returns the weight of the layer at the specified index.
Animator.GetNextAnimatorClipInfo(layerIndex) Method Returns an array of all the AnimatorClipInfo in the next state of the given layer.
Animator.GetNextAnimatorClipInfoCount(layerIndex) Method Returns the number of AnimatorClipInfo in the next state.
Animator.GetNextAnimatorStateInfo(layerIndex) Method Returns an AnimatorStateInfo with the information on the next state.
Animator.GetParameter(index) Method Get animator controller parameter.
Animator.HasState(layerIndex, stateID) Method Returns true if the state exists in this layer, false otherwise.
Animator.InterruptMatchTarget(completeMatch) Method Interrupts the automatic target matching.
Animator.IsInTransition(layerIndex) Method Returns true if there is a transition on the given layer, false otherwise.
Animator.IsParameterControlledByCurve(name) Method Returns true if the parameter is controlled by a curve, false otherwise.
Animator.MatchTarget(matchPosition, matchRotation, targetBodyPart, positionXYZWeight , rotationWeight, startNormalizedTime, targetNormalizedTime, completeMatch=1) Method Automatically adjust the GameObject position and rotation.
Animator.Play(stateName, layer, normalizedTime=-#INF) Method Plays a state.
Animator.PlayInFixedTime(stateName, layer=-1, fixedTime=-#INF) Method Plays a state.
Animator.Rebind() Method Rebind all the animated properties and mesh data with the Animator.
Animator.ResetTrigger(name) Method Resets the value of the given trigger parameter.
Animator.SetBoneLocalRotation(humanBoneId, rotation) Method Sets local rotation of a human bone during a IK pass.
Animator.SetBool(name, value) Method Sets the value of the given boolean parameter.
Animator.SetFloat(name, value) Method Send float values to the Animator to affect transitions.
Animator.SetFloat(name, value, dampTime, deltaTime) Method Send float values to the Animator to affect transitions.
Animator.SetIKHintPosition(hint, hintPosition) Method Sets the position of an IK hint.
Animator.SetIKHintPositionWeight(hint, value) Method Sets the translative weight of an IK hint (0 = at the original animation before IK, 1 = at the hint).
Animator.SetIKPosition(goal, goalPosition) Method Sets the position of an IK goal.
Animator.SetIKPositionWeight(goal, value) Method Sets the translative weight of an IK goal (0 = at the original animation before IK, 1 = at the goal).
Animator.SetIKRotation(goal, goalRotation) Method Sets the rotation of an IK goal.
Animator.SetIKRotationWeight(goal, value) Method Sets the rotational weight of an IK goal (0 = rotation before IK, 1 = rotation at the IK goal).
Animator.SetInteger(name, value) Method Sets the value of the given integer parameter.
Animator.SetLayerWeight(layerIndex, weight) Method Sets the weight of the layer at the given index.
Animator.SetLookAtPosition(lookAtPosition) Method Sets the look at position.
Animator.SetLookAtWeight(weight, bodyWeight=0, headWeight=1, eyesWeight=0, clampWeight=0.5) Method Set look at weights.
Animator.SetTarget(targetIndex, targetNormalizedTime) Method Sets an AvatarTarget and a targetNormalizedTime for the current state.
Animator.SetTrigger(name) Method Sets the value of the given trigger parameter.
Animator.StartPlayback() Method Sets the animator in playback mode.
Animator.StopPlayback() Method Stops the animator playback mode. When playback stops, the avatar resumes getting control from game logic.
Animator.Update(deltaTime) Method Evaluates the animator based on deltaTime.
Animator.WriteDefaultValues() Method Forces a write of the default values stored in the animator.

Static Methods⚓︎

Name Description
Animator.StringToHash(name) Static fieldMethod Generates an parameter id from a string.

Inherited Members⚓︎

Inherited Properties⚓︎

Name Description
Animator.enabledProperty Enabled Behaviours are Updated, disabled Behaviours are not.
Animator.isActiveAndEnabledProperty Has the Behaviour had active and enabled called?
Animator.gameObjectPropertyReadonly Property The game object this component is attached to. A component is always attached to a game object.
Animator.tagPropertyReadonly Property The tag of this game object.
Animator.transformPropertyReadonly Property The Transform attached to this GameObject.
Animator.hideFlagsProperty Should the object be hidden, saved with the Scene or modifiable by the user?
Animator.nameProperty The name of the object.

Inherited Methods⚓︎

Name Description
Animator.BroadcastMessage(methodName, parameter=nil)Method Calls the method named methodName on every Lua Script in this game object or any of its children.
Animator.CompareTag(tag)Method Is this game object tagged with tag ?
Animator.GetAllLuaScripts()Method Returns an array of all Lua scripts that attached to the game object.
Animator.GetComponent(type)Method Returns the component of Type type if the game object has one attached, nil if it doesn't.
Animator.GetComponentInChildren(t)Method Returns the component of Type type in the GameObject or any of its children using depth first search.
Animator.GetComponentInParent(t)Method Returns the component of Type type in the GameObject or any of its parents.
Animator.GetComponents(type)Method Returns all components of Type type in the GameObject.
Animator.GetComponentsInChildren(t)Method Returns all components of Type type in the GameObject or any of its children.
Animator.GetComponentsInParent(t)Method Returns all components of Type type in the GameObject or any of its parents.
Animator.SendMessage(methodName, value=nil)Method Calls the method named methodName on every Lua Script in this game object.
Animator.SendMessageUpwards(methodName, value=nil)Method Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour.
Animator.TryGetComponent(type)Method Gets the component of the specified type, if it exists.
Animator.GetInstanceID()Method Returns the instance id of the object.