- Home /
Is there a way to limit a parent object's child count to only 1 without individually doing it with each transform?
I have a pool of children that randomly activates under a list of parents, problem is I only want the parents to have one child each but since its randomized, sometimes a parent hosts more than one child. It's not pleasant to have to individually detail the transform for each of the 20 children, which may grow in the future.
thisVar = obj1[Random.Range(0,obj1.Length)]; // Attatch it to the tiles randomly children.transform.parent = thisVar.transform;
Comment
Your answer
Follow this Question
Related Questions
Find children in parent 8 Answers
Manipulating Instanced Object 2 Answers
How to make multiple gameobjects child of one and the same transform (SCRIPT) 2 Answers
Parenting 1 object/Removing child/ pick up 1 Answer
Parenting a Parent? 1 Answer