unity call children code example
Example 1: unity get child
GameObject Child;
Child = transform.GetChild(0).gameObject;
Example 2: how to reference a child object unity
private void Start()
{
parentObject = GameObject.Find("Parent");
childObject = parentObject.transform.GetChild(0).gameObject;
}
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;