Is there some sort of voodoo magic that I’m missing? How come you can get ALL of your children’s children, but can’t get your immediate children? Am I missing a method? I love Unity, but who implements a ‘GET ALL DESCENDENTS’ without adding a ‘GET MY IMMEDIATE CHILDREN’ method?
Thanks that make me go hmmm…
Gigiwoo.
PS - Yes, I know I can ask each child if I am their parent, but… that seems silly.
Maybe not exactly how you do it. You need to take into consideration that GetComponentsInChildren only returns components in active gameobjects. Your code would return all children which are also inactive. This may or not be what the OP wants.
Edit: Just realized you bumped a 5 year old thread.