Legacy Documentation: Version 5.5
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

AnimatorStateMachine

class in UnityEditor.Animations

/

Inherits from:Object

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

A graph controlling the interaction of states. Each state references a motion.

Variables

anyStatePositionThe position of the AnyState node.
anyStateTransitionsThe list of AnyState transitions.
behavioursThe Behaviour list assigned to this state machine.
defaultStateThe state that the state machine will be in when it starts.
entryPositionThe position of the entry node.
entryTransitionsThe list of entry transitions in the state machine.
exitPositionThe position of the exit node.
parentStateMachinePositionThe position of the parent state machine node. Only valid when in a hierachic state machine.
stateMachinesThe list of sub state machines.
statesThe list of states.

Public Functions

AddAnyStateTransitionUtility function to add an AnyState transition to the specified state or statemachine.
AddEntryTransitionUtility function to add an incoming transition to the exit of it's parent state machine.
AddStateUtility function to add a state to the state machine.
AddStateMachineUtility function to add a state machine to the state machine.
AddStateMachineBehaviourAdds a state machine behaviour class of type stateMachineBehaviourType to the AnimatorStateMachine. C# Users can use a generic version.
AddStateMachineExitTransitionUtility function to add an outgoing transition from the source state machine to the exit of it's parent state machine.
AddStateMachineTransitionUtility function to add an outgoing transition from the source state machine to the destination.
GetStateMachineTransitionsGets the list of all outgoing state machine transitions from given state machine.
MakeUniqueStateMachineNameMakes a unique state machine name in the context of the parent state machine.
MakeUniqueStateNameMakes a unique state name in the context of the parent state machine.
RemoveAnyStateTransitionUtility function to remove an AnyState transition from the state machine.
RemoveEntryTransitionUtility function to remove an entry transition from the state machine.
RemoveStateUtility function to remove a state from the state machine.
RemoveStateMachineUtility function to remove a state machine from its parent state machine.
RemoveStateMachineTransitionUtility function to remove an outgoing transition from source state machine.
SetStateMachineTransitionsSets the list of all outgoing state machine transitions from given state machine.

Inherited members

Variables

hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameThe name of the object.

Public Functions

GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the game object.

Static Functions

DestroyRemoves a gameobject, component or asset.
DestroyImmediateDestroys the object obj immediately.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.