# SetSortIndex(in HierarchyNode, int)

> Sets the sorting index for a hierarchy node.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Hierarchy](/engine/6000.5/script-reference/unity/hierarchy.md)
* **Assembly:** UnityEngine.HierarchyCoreModule

## SetSortIndex(HierarchyNode, int)

```csharp
public bool SetSortIndex(in HierarchyNode node, int sortIndex)
```

### Parameters

**** (\[HierarchyNode]\(/engine/6000.5/script-reference/unity/hierarchy/hierarchynode)): The hierarchy node to set a sorting index for.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The sorting index.

### Returns

| Type                                                          | Description                                                        |
| ------------------------------------------------------------- | ------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if the command was appended to the list, `false` otherwise. |
