BoxCollider 2D not working as child object of Dynamic Rigidbody 2D

Hello everyone,

I tried to find a solution before on the forum but couldn’t find the exact same issue.
I have a parent game object that is a Rigidbody 2D, and this object has children that are BoxColliders 2D.
(The parent object needs to be dragged, and the child blocks need to move along with it and to be colliders).
It used to work in the past – so i’m not sure if an Unity update broke this.
But now my other Rigidbody 2D doesn’t collide with these child BoxColliders any more.

Is there a (new ?) rule I don’t know about using BoxColliders as child of a Rigidbody ? (or sometimes in the very same object)

By the way :
I haven’t assigned any material to the BoxCollider 2D and Rigidbody 2D, as I don’t think they need it.
The Rigidbody is Dynamic and I’d like to keep it that way.

Thanks for your help

The physics system doesn’t know anything about parent/children in reality. Basically you’re saying 2D physics is completely broken here because colliders cannot move independently of bodies, they live in the space of the body so their position is defined by the position of the body as they live relative to it.

Try this without any scripts in a new project.

Months later, here I am again. I got rushed in plenty of other stuff.
Thanks for the info MelvMay, I didn’t know that, that way.

I [SOLVED] my issue - it was something else - so if by any chance that could be useful for someone here’s the explanation :

  • I tried with a backup of the project, and Unity 2018, no issues
  • I exchanged the scripts, gameobjects attributes etc. not working in Unity 2021
  • IN THE END, I tried unticking the checkbox Constraints > Freeze Position > Y
    (in the parent rigidbody of the child 2DCollider) which didn’t cause any issues in the past
  • And it worked, the collider rigidbody coming from the top (Y) now collides as expected !

Have a nice day

I don’t really follow what the problem is or your solution but glad you’re working again.