Detecting collision from only a child object's collider2D

I have an object with a box collider2D and a childed object with a separate collider2D.

Lets call the parent object Body and the child object Feet.

If the body hits another collider2D, I want to destroy the Body, but the feet should not have any effect.

The problem is when I attach a script that destroys the Body on collision, the object is also destroyed when the child object’s (Feet) collider2D hits the ground.

How can I select which collider2D on an object with multiple children and colliders results in a specific event? Thanks in advance, everyone

Edit: I’ve read a lot about Layers, the thing is, I want the feet and body colliding with the same ground objects on one layer, I just want the gameObject destroyed if the Body and not the Feet touch the ground

in the past I have just put a separate script on the children along with separate colliders on the children in the inpector. usually children die with parents but im sure you could drop both body and feet both into an empty game object so they would both be children. and put whatever main scripts on the empty game object that contains both.

hope that helps!

Try this. set your children to prefab.