I have this piece of code to acess the transform of the first child:
Transform child_transform = transform.GetChild(0);
but, in some point of the code, this child is destroyed:
But when its destroyed, unity gives and error saying that the reference was destroyed (and in fact it was).
But the fact is that the parent always have more than one child (in other words, when the first one is destroyed, another one takes the place as the first one), and i wish that my script keep returning the transform of the first child, despite the previous one was destroyed.
How can i do that?
Disclaimer: its a 2d game, flappy bird like