Answers for "how to choose a random child in a gameobject unuity"

C#
0

how to choose a random child in a gameobject unuity

public GameObject YourGameObject;

int randomChildIdx = Math.Random(0, YourGameObject.transform.childCount);
Transform randomChild = YourGameObject.transform.GetChild(randomChildIdx);
Posted by: Guest on October-31-2020

Code answers related to "how to choose a random child in a gameobject unuity"

C# Answers by Framework

Browse Popular Code Answers by Language