Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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);
 
PREVIOUS NEXT
Tagged: #choose #random #child #gameobject #unuity
ADD COMMENT
Topic
Name
1+8 =