Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetChildIndex(in HierarchyNode)

Gets the index of a hierarchy node in its parent's children list.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: Unity.Hierarchy
  • Assembly: UnityEngine.HierarchyCoreModule

GetChildIndex(HierarchyNode)

public int GetChildIndex(in HierarchyNode node)

Parameters

The hierarchy node to get the child index for.

Returns

Type

Description

intThe index of the node within its parent's children list, or -1 if the node is invalid.