# GetChildIndex(in HierarchyNode)

> Gets the index of a hierarchy node in its parent's children list.

## Definition

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

## GetChildIndex(HierarchyNode)

```csharp
public int GetChildIndex(in HierarchyNode node)
```

### Parameters

**** (\[HierarchyNode]\(/engine/6000.7/script-reference/unity/hierarchy/hierarchynode)): The hierarchy node to get the child index for.

### Returns

| Type                                                       | Description                                                                            |
| ---------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The index of the node within its parent's children list, or -1 if the node is invalid. |
