# SelfTransition

> The base class for all user-accessible self transitions in a StateMachine graph.

## Definition

* **Type:** Class
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.7/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor
* **Implements:** [ISelfTransition](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iselftransition.md), [ITransition](/engine/6000.7/script-reference/unity/graphtoolkit/editor/itransition.md)

```csharp
public abstract class SelfTransition : ISelfTransition, ITransition
```

## Remarks

Inherit from this class to define custom self transition types that appear in a state machine graph. A self transition is anchored on a single [State](/engine/6000.7/script-reference/unity/graphtoolkit/editor/state.md) rather than connecting two states.

To create a custom self transition, derive from [SelfTransition](/engine/6000.7/script-reference/unity/graphtoolkit/editor/selftransition.md). Apply a [TransitionAttribute](/engine/6000.7/script-reference/unity/graphtoolkit/editor/transitionattribute.md) to the class to further customize the self transition. Custom transitions appear in the `Create Transition` menu of a state and can be created on it.

See also:

* [StateMachine](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachine.md) for the graph type that contains states and transitions

* [State](/engine/6000.7/script-reference/unity/graphtoolkit/editor/state.md) for the base class used to define custom states

## Properties

| Property                                                                                       | Description                                           |
| ---------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| [Tooltip](/engine/6000.7/script-reference/unity/graphtoolkit/editor/selftransition/tooltip.md) | The text displayed when hovering over the transition. |

## Methods

| Method                                                                                             | Description                                                                 |
| -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [OnDisable](/engine/6000.7/script-reference/unity/graphtoolkit/editor/selftransition/ondisable.md) | Called when the transition is removed or when the graph is disabled.        |
| [OnEnable](/engine/6000.7/script-reference/unity/graphtoolkit/editor/selftransition/onenable.md)   | Called when the transition is created or when the state machine is enabled. |
