I have tried making an empty GameObject as a parent, but when I press play the objects still fall over and spread apart. (They have rigidbodies.)
Parenting doesn’t make / help Rigidbodies stay together.
Instead you want to use some kind of a Joint.
If you really want two Rigidbody-controlled GameObjects to be “nailed” together, use a FixedJoint / FixedJoint2D between them.
NOTE: the solver may still allow slight deflection between them if the forces are high enough that it can’t solve the problem without overlap. To see what I mean, make two Rigidbody cubes atop each other, join them with a Fixed Joint, and make the top one much heavier than the bottom, then drop it on the ground.
That worked but the objects just stay in the air together without falling to the ground, even though they have rigidbodies. I need them to fall to the ground, but still be glued together.
That isn’t because of the fixed joint. Isolate, isolate, isolate, make a fresh demo with 2 cubes, 2 rbs and a fixed joint, we know it works.
If you have a joint attached to nothing, the joint will fix the body to a point in space. Make sure all the joints are connecting two rigidbodies.
Good point. Let me revise what I said above:
“That isn’t because of properly-configured FixedJoints.”
Perhaps you haven’t configured your joints fully.
See attached example of FixedJoint holding two Rigidbodies together, and ditto for 2D…