Thomas Cheung
0
Q:

unity get all children

foreach (Transform child in parent) {
  //Your code
}
5
GameObject Child;
Child = transform.GetChild(0).gameObject;
5
foreach (Transform child in transform)     
4
    public List<GameObject> childrens = new List<GameObject>();

    void Update()
    {
      foreach (Transform child in transform)
      {           
          if (!childrens.Contains(child.gameObject))
          {
              childrens.Add(child.gameObject);
          }                            
      }
    }
1

New to Communities?

Join the community