Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

gameobject children order

Discussion in 'Scripting' started by IntDev, Apr 26, 2016.

  1. IntDev

    IntDev

    Joined:
    Jan 14, 2013
    Posts:
    152
    Is the order that appear in the Hierarchy View always true when I iterate through the children of a gameobject or when I get them by transform.GetChild(x) ?
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    yes, you're passing the sibling index (see the other get/set sibling functions on transform)

    first one... how are you performing the iteration?