Skip to main content

Animator

info

Animator inherits from Behaviour

Interface to control the Mecanim animation system. Unity Animator

Members

Properties

NameDescription
Animator.angularVelocityGets the avatar angular velocity for the last evaluated frame.
Animator.applyRootMotionShould root motion be applied?
Animator.avatarGets/Sets the current Avatar.
Animator.bodyPositionThe position of the body center of mass.
Animator.bodyRotationThe rotation of the body center of mass.
Animator.cullingModeControls culling of this Animator component.
Animator.deltaPositionGets the avatar delta position for the last evaluated frame.
Animator.deltaRotationGets the avatar delta rotation for the last evaluated frame.
Animator.feetPivotActiveBlends pivot point between body center of mass and feet pivot.
Animator.fireEventsSets whether the Animator sends events of type AnimationEvent.
Animator.gravityWeightThe current gravity weight based on current animations that are played.
Animator.hasBoundPlayablesReturns true if Animator has any playables assigned to it.
Animator.hasRootMotionReturns true if the current rig has root motion.
Animator.hasTransformHierarchyReturns true if the object has a transform hierarchy.
Animator.humanScaleReturns the scale of the current Avatar for a humanoid rig, (1 by default if the rig is generic).
Animator.isHumanReturns true if the current rig is humanoid, false if it is generic.
Animator.isInitializedReturns whether the animator is initialized successfully.
Animator.isMatchingTargetIf automatic matching is active.
Animator.isOptimizableReturns true if the current rig is optimizable with AnimatorUtility.OptimizeTransformHierarchy.
Animator.keepAnimatorControllerStateOnDisableControls the behaviour of the Animator component when a GameObject is disabled.
Animator.layerCountReturns the number of layers in the controller.
Animator.layersAffectMassCenterAdditional layers affects the center of mass.
Animator.leftFeetBottomHeightGet left foot bottom height.
Animator.parameterCountReturns the number of parameters in the controller.
Animator.parametersThe AnimatorControllerParameter list used by the animator. (Read Only)
Animator.pivotPositionGet the current position of the pivot.
Animator.pivotWeightGets the pivot weight.
Animator.playbackTimeSets the playback position in the recording buffer.
Animator.rightFeetBottomHeightGet right foot bottom height.
Animator.rootPositionThe root position, the position of the game object.
Animator.rootRotationThe root rotation, the rotation of the game object.
Animator.runtimeAnimatorControllerThe runtime representation of AnimatorController that controls the Animator.
Animator.speedThe playback speed of the Animator. 1 is normal playback speed.
Animator.stabilizeFeetAutomatic stabilization of feet during transition and blending.
Animator.targetPositionReturns the position of the target specified by SetTarget.
Animator.targetRotationReturns the rotation of the target specified by SetTarget.
Animator.updateModeSpecifies the update mode of the Animator.
Animator.velocityGets the avatar velocity for the last evaluated frame.

Methods

NameDescription
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

NameDescription
Animator.StringToHash(name)Generates an parameter id from a string.

Inherited Members

Inherited Properties

NameDescription
Animator.enabledEnabled Behaviours are Updated, disabled Behaviours are not.
Animator.isActiveAndEnabledHas the Behaviour had active and enabled called?
Animator.gameObjectThe game object this component is attached to. A component is always attached to a game object.
Animator.tagThe tag of this game object.
Animator.transformThe Transform attached to this GameObject.
Animator.hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
Animator.nameThe name of the object.

Inherited Methods

NameDescription
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.