Skip to main content
added 142 characters in body
Source Link
Justin Markwell
  • 2.2k
  • 2
  • 14
  • 16

you can use transform.GetChild(0) you can also get children of children transform.GetChild(0).GetChild(0)

or you can pull a array of each child and work with that also

    for (int i = 0; i < transform.childCount; i++)
    {
        //do stuff
        
    } 

or

    foreach (Transform child in transform)
    {
        // do stuff
    }

you can use transform.GetChild(0) you can also get children of children transform.GetChild(0).GetChild(0)

or you can pull a array of each child and work with that also

    for (int i = 0; i < transform.childCount; i++)
    {
        //do stuff
    } 

you can use transform.GetChild(0) you can also get children of children transform.GetChild(0).GetChild(0)

or you can pull a array of each child and work with that also

    for (int i = 0; i < transform.childCount; i++)
    {
        //do stuff
        
    } 

or

    foreach (Transform child in transform)
    {
        // do stuff
    }
Source Link
Justin Markwell
  • 2.2k
  • 2
  • 14
  • 16

you can use transform.GetChild(0) you can also get children of children transform.GetChild(0).GetChild(0)

or you can pull a array of each child and work with that also

    for (int i = 0; i < transform.childCount; i++)
    {
        //do stuff
    }