# GetOption(int)

> Retrieves a state option using its zero-based index.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.7/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
public IStateOption GetOption(int index)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index of the option, based on the order in which the options were declared.

### Returns

| Type                                                                                      | Description                        |
| ----------------------------------------------------------------------------------------- | ---------------------------------- |
| [IStateOption](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption.md) | The option at the specified index. |

### Remarks

The index is zero-based.

Throws ArgumentOutOfRangeException when the index is out of bounds.

### Examples

```csharp
var firstOption = myState.GetOption(0);
```
