Acces a child of a gameObject in Unity c#

Acces a child of a gameObject in Unity c#

// Get the first child from the parent object
theNameOfParentGameObject.transform.GetChild(0).gameObject

// The name of the parent we want the child gameobject from.
theNameOfParentGameObject.

// transform of the object.  
transform. 

// Using Unity GetChild() function.
GetChild(0). 

// Getting the child as a game object.
gameObject