unity how to access child objects code example
Example 1: unity access child
parentGameObject.transform.GetChild(0).gameObject
Example 2: unity how to get a child from a gameobject
GameObject.transform.GetChild(The child index).transform;
Example 3: unity get child gameobject
GameObject originalGameObject = Instantiate(prefab);
GameObject child2 = originalGameObject.transform.GetChild(0).gameObject;
GameObject child2 = originalGameObject.transform.GetChild(1).gameObject;
GameObject child3 = originalGameObject.transform.GetChild(2).gameObject;