# AnimatorStateMachine

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

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor.Animations](/engine/6000.0/script-reference/unityeditor/animations.md)
* **Assembly:** UnityEditor
* **Inherits from:** [Object](/engine/6000.0/script-reference/unityengine/object.md)

```csharp
[HelpURL("NestedStateMachines")]
public sealed class AnimatorStateMachine : Object
```

## Properties

| Property                                                                                                                                | Description                                                                                  |
| --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [anyStatePosition](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/anystateposition.md)                     | The position of the AnyState node.                                                           |
| [anyStateTransitions](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/anystatetransitions.md)               | The list of AnyState transitions.                                                            |
| [behaviours](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/behaviours.md)                                 | The Behaviour list assigned to this state machine.                                           |
| [defaultState](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/defaultstate.md)                             | The state that the state machine will be in when it starts.                                  |
| [entryPosition](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/entryposition.md)                           | The position of the entry node.                                                              |
| [entryTransitions](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/entrytransitions.md)                     | The list of entry transitions in the state machine.                                          |
| [exitPosition](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/exitposition.md)                             | The position of the exit node.                                                               |
| [parentStateMachinePosition](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/parentstatemachineposition.md) | The position of the parent state machine node. Only valid when in a hierachic state machine. |
| [stateMachines](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/statemachines.md)                           | The list of sub state machines.                                                              |
| [states](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/states.md)                                         | The list of states.                                                                          |

## Methods

| Method                                                                                                                                        | Description                                                                                                            |
| --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| [AddAnyStateTransition](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/addanystatetransition.md)                 | Utility function to add an AnyState transition to the specified state or statemachine.                                 |
| [AddEntryTransition](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/addentrytransition.md)                       | Utility function to add an incoming transition to the exit of it's parent state machine.                               |
| [AddState](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/addstate.md)                                           | Utility function to add a state to the state machine.                                                                  |
| [AddStateMachine](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/addstatemachine.md)                             | Utility function to add a state machine to the state machine.                                                          |
| [AddStateMachineBehaviour](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/addstatemachinebehaviour.md)           | A non-generic version of this method.                                                                                  |
| [AddStateMachineExitTransition](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/addstatemachineexittransition.md) | Utility function to add an outgoing transition from the source state machine to the exit of it's parent state machine. |
| [AddStateMachineTransition](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/addstatemachinetransition.md)         | Utility function to add an outgoing transition from the source state machine to the destination.                       |
| [GetStateMachineTransitions](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/getstatemachinetransitions.md)       | Gets the list of all outgoing state machine transitions from given state machine.                                      |
| [MakeUniqueStateMachineName](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/makeuniquestatemachinename.md)       | Makes a unique state machine name in the context of the parent state machine.                                          |
| [MakeUniqueStateName](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/makeuniquestatename.md)                     | Makes a unique state name in the context of the parent state machine.                                                  |
| [RemoveAnyStateTransition](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/removeanystatetransition.md)           | Utility function to remove an AnyState transition from the state machine.                                              |
| [RemoveEntryTransition](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/removeentrytransition.md)                 | Utility function to remove an entry transition from the state machine.                                                 |
| [RemoveState](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/removestate.md)                                     | Utility function to remove a state from the state machine.                                                             |
| [RemoveStateMachine](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/removestatemachine.md)                       | Utility function to remove a state machine from its parent state machine.                                              |
| [RemoveStateMachineTransition](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/removestatemachinetransition.md)   | Utility function to remove an outgoing transition from source state machine.                                           |
| [SetStateMachineTransitions](/engine/6000.0/script-reference/unityeditor/animations/animatorstatemachine/setstatemachinetransitions.md)       | Sets the list of all outgoing state machine transitions from given state machine.                                      |

## Inheritance

**Inherited Members:**

* [Object.GetInstanceID()](/engine/6000.0/script-reference/unityengine/object/getinstanceid.md)
* [Object.GetHashCode()](/engine/6000.0/script-reference/unityengine/object/gethashcode.md)
* [Object.InstantiateAsync\<T>(T)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, InstantiateParameters, CancellationToken)](/engine/6000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.Instantiate(Object, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion\))
* [Object.Instantiate(Object, Vector3, Quaternion, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion-transform\))
* [Object.Instantiate(Object)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object\))
* [Object.Instantiate(Object, Scene)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-scene\))
* [Object.Instantiate\<T>(T, InstantiateParameters)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, InstantiateParameters)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate(Object, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform\))
* [Object.Instantiate(Object, Transform, bool)](/engine/6000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform-bool\))
* [Object.Instantiate\<T>(T)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform, bool)](/engine/6000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Destroy(Object, float)](/engine/6000.0/script-reference/unityengine/object/destroy.md)
* [Object.DestroyImmediate(Object, bool)](/engine/6000.0/script-reference/unityengine/object/destroyimmediate.md)
* [Object.FindObjectsByType(Type, FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type-findobjectssortmode\))
* [Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type-findobjectsinactive-findobjectssortmode\))
* [Object.DontDestroyOnLoad(Object)](/engine/6000.0/script-reference/unityengine/object/dontdestroyonload.md)
* [Object.FindObjectsByType\<T>(FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(findobjectssortmode\))
* [Object.FindObjectsByType\<T>(FindObjectsInactive, FindObjectsSortMode)](/engine/6000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(findobjectsinactive-findobjectssortmode\))
* [Object.FindFirstObjectByType\<T>()](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytypet\(\))
* [Object.FindAnyObjectByType\<T>()](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(\))
* [Object.FindFirstObjectByType\<T>(FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytypet\(findobjectsinactive\))
* [Object.FindAnyObjectByType\<T>(FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(findobjectsinactive\))
* [Object.FindFirstObjectByType(Type)](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytype\(type\))
* [Object.FindAnyObjectByType(Type)](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type\))
* [Object.FindFirstObjectByType(Type, FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findfirstobjectbytype.md#findfirstobjectbytype\(type-findobjectsinactive\))
* [Object.FindAnyObjectByType(Type, FindObjectsInactive)](/engine/6000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type-findobjectsinactive\))
* [Object.ToString()](/engine/6000.0/script-reference/unityengine/object/tostring.md)
* [Object.name](/engine/6000.0/script-reference/unityengine/object/name.md)
* [Object.hideFlags](/engine/6000.0/script-reference/unityengine/object/hideflags.md)

### Operators

| Operator                                                                           | Description                                                             |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [operator ==](/engine/6000.0/script-reference/unityengine/object/op-equality.md)   | Compares two object references to see if they refer to the same object. |
| [bool](/engine/6000.0/script-reference/unityengine/object/op-implicit.md)          | Determines whether the object exists.                                   |
| [operator !=](/engine/6000.0/script-reference/unityengine/object/op-inequality.md) | Compares if two objects refer to a different object.                    |
