I am using this code
private Transform FindChildOf(Transform parentObject)
{
Debug.Log("parentObject : "+parentObject.name);
foreach(Transform childObject in parentObject)
{
Debug.Log("child : "+childObject.name);
return childObject;
}
return null;
}
It returns only one of the child. I want it to return all the child.
I am doing something wrong . I am not able to figure out what is wrong.