# AddTransition

> Utility function to add an outgoing transition.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Animations](/engine/6000.7/script-reference/unityeditor/animations.md)
* **Assembly:** UnityEditor.CoreModule

## AddTransition(AnimatorStateTransition)

Utility function to add an outgoing transition.

```csharp
public void AddTransition(AnimatorStateTransition transition)
```

### Parameters

**** (\[AnimatorStateTransition]\(/engine/6000.7/script-reference/unityeditor/animations/animatorstatetransition)): The transition to add.

### Remarks

This function pushes an Undo operation.

## AddTransition(AnimatorState)

Utility function to add an outgoing transition to the destination state.

```csharp
public AnimatorStateTransition AddTransition(AnimatorState destinationState)
```

### Parameters

**** (\[AnimatorState]\(/engine/6000.7/script-reference/unityeditor/animations/animatorstate)): The destination state.

### Returns

| Type                                                                                                         | Description |
| ------------------------------------------------------------------------------------------------------------ | ----------- |
| [AnimatorStateTransition](/engine/6000.7/script-reference/unityeditor/animations/animatorstatetransition.md) |             |

### Remarks

The transition asset that is created is added as a sub asset of the state. This function pushes an Undo operation.

## AddTransition(AnimatorStateMachine)

Utility function to add an outgoing transition to the destination state machine.

```csharp
public AnimatorStateTransition AddTransition(AnimatorStateMachine destinationStateMachine)
```

### Parameters

**** (\[AnimatorStateMachine]\(/engine/6000.7/script-reference/unityeditor/animations/animatorstatemachine)): The destination state machine.

### Returns

| Type                                                                                                         | Description |
| ------------------------------------------------------------------------------------------------------------ | ----------- |
| [AnimatorStateTransition](/engine/6000.7/script-reference/unityeditor/animations/animatorstatetransition.md) |             |

### Remarks

The transition asset that is created is added as a sub asset of the state. This function pushes an Undo operation.

## AddTransition(AnimatorState, bool)

Utility function to add an outgoing transition to the destination state.

```csharp
public AnimatorStateTransition AddTransition(AnimatorState destinationState, bool defaultExitTime)
```

### Parameters

**** (\[AnimatorState]\(/engine/6000.7/script-reference/unityeditor/animations/animatorstate)): The destination state.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): If true, the exit time will be the equivalent of 0.25 second.

### Returns

| Type                                                                                                         | Description |
| ------------------------------------------------------------------------------------------------------------ | ----------- |
| [AnimatorStateTransition](/engine/6000.7/script-reference/unityeditor/animations/animatorstatetransition.md) |             |

### Remarks

The transition asset that is created is added as a sub asset of the state. This function pushes an Undo operation.

## AddTransition(AnimatorStateMachine, bool)

Utility function to add an outgoing transition to the destination state machine.

```csharp
public AnimatorStateTransition AddTransition(AnimatorStateMachine destinationStateMachine, bool defaultExitTime)
```

### Parameters

**** (\[AnimatorStateMachine]\(/engine/6000.7/script-reference/unityeditor/animations/animatorstatemachine)): The destination state machine.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): If true, the exit time will be the equivalent of 0.25 second.

### Returns

| Type                                                                                                         | Description |
| ------------------------------------------------------------------------------------------------------------ | ----------- |
| [AnimatorStateTransition](/engine/6000.7/script-reference/unityeditor/animations/animatorstatetransition.md) |             |

### Remarks

The transition asset that is created is added as a sub asset of the state. This function pushes an Undo operation.
