A trigger to kill all parts of an enemy?

This is a general question, but I have multiple box collisions and triggers on my enemies in my game. My character has a power up that makes her kill anything she touches, but sometimes not ALL of the parts of the enemy are taken out (such as the moving script or others{I have enemies you can bounce on and stuff}).

I was wondering if there was a way for me to just make a trigger and say, “EVERYTHING that is a child of this… if the player has the powerup and hits this trigger… kill everything… KILL ALL THE CHILDREN!!”

…is there a script that allows me to kill all the children? If you need more information from me, let me know and I’ll tell you more things in depth. Thanks a lot for your help!

Do some search before posting question. They are a lot of way to destroy childrens. One of multiple answer

Well, if you want the colliders to be ‘gone’ from the game world and never come back, you already gave your answers yourself you simply search all the children and destroy them.

var parent:Transform;


for (var:Child in parent){


Transform parent;

foreach(Transform child in parent) {



Now note that this is made on the fly and has not been tested, but it gives you a general starting point to go from.

Now if you want only to delete the scripts of the enemy but keeps all its GameObjects alive in the game you should take a look at this Unity - Scripting API: Component.GetComponentsInChildren