Use OnColliderEnter2D when the collider is inside another gameobject

Hello everybody,

I’m need your help about something that look simple but I don’t get how to make it works.
I created a stickman with hinge joints 2D. Each parts of the stickman body use box collider 2D or circle collider 2D.

But when it comes to collision, the script on the stickman gameobject don’t get any result. So i tried to create another script and I used it on the stickman legs (inside the previous gameObject) and here it detect the collision.

How can I use my script on the whole body and not only on legs but still have my collision working as expected ?

Thanks you !

I found how to deal with that thing.

I created another script like my last attempt but I also created a variable inside of that script that can be access by another script.

So now, everything is working into this new script and it send the result of the value in my main stickmanController script.