What holds 2D GameObjects Together?

Long post sorry!

PROBLEM:
I have a GameObject with multiple child objects. The parent and all the childern each have sprite renderers, rigidbody2Ds and colliders. They’re all various parts of a large tank.

As the parent moves around, the childern follow it and the tank rolls along the ground. As the various childern encounter obsticles, sometimes they come apart.

I set it up as seperate child objects as they are each different moving parts and they take damage seperately, have seperate animators, etc.

EXAMPLE:
If the tank is moving fast and hits a short wall, the treds/wheels (which are their own child object) will hit the wall and stop dead and the top of the tank will seperate and continue moving. Eventually crashing to the ground beyond the wall. While this is neat in its own right, it would rather if the whole tank would stay together and stop.

QUESTION:
Is there a way to “lock” the child obects in place so that the tank stays together (unless commanded to explode of course).

Thanks!!

You are looking for some sort of Joint. Start with:

… but a spring joint might be better for some connections.