Answers for "unity how to loop on children"

C#
4

unity cycle children

for(int i = 0; i < gameobject.transform.GetChildCount(); i++)
{
   Transform Children = gameobject.transform.GetChild(i);
}
Posted by: Guest on March-23-2020
3

unity foreach child

foreach(Transform child in transform)
{
	print(child.gameObject.name)
}
Posted by: Guest on April-22-2021

C# Answers by Framework

Browse Popular Code Answers by Language