// To acces a child of a gameObject use the combination below
parentGameObject.transform.GetChild(0).gameObject
GameObject Child;
Child = transform.GetChild(0).gameObject;
//with the index
parentGameObject.transform.GetChild(0).gameObject
//or with the name
parentGameObject.transform.GetChild("name").gameObject
GameObject originalGameObject = GameObject.Find("MainObj");
GameObject child = originalGameObject.transform.GetChild(0).gameObject;
Transform[] transforms = this.GetComponentsInChildren<Transform>();
foreach(Transform t in transforms)
{
if (t.gameObject.name == "Child")
{
Debug.Log ("Found " + t);
}
}
public Component GetComponentInChildren(Type t);