# Insert(int, ICondition)

> Inserts a condition into this group at the specified index.

## Definition

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

```csharp
void Insert(int index, ICondition condition)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The zero-based index at which to insert the condition. Pass [IGroupCondition.Count](/engine/6000.7/script-reference/unity/graphtoolkit/editor/igroupcondition/count.md) to append the condition at the end of the group.**** (\[ICondition]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/icondition)): The condition to insert.

### Remarks

If the condition already belongs to another group, it is first removed from that group. Throws ArgumentOutOfRangeException when the index is less than 0 or greater than [IGroupCondition.Count](/engine/6000.7/script-reference/unity/graphtoolkit/editor/igroupcondition/count.md). Throws ArgumentException when the condition is this group or a group that contains this group, or when the condition, or one of its nested conditions, uses a variable from another graph.
