I recently started making a game where the point is to build structures made of blocks and other parts and the built structures can move around and collide with others, kind of like the game Scrap Mechanic.
The blocks have to be joined together (FixedJoint was too weak, so I had to use a ConfigurableJoint), but the problem might be that after a while, hundreds or thousands of objects will be joined together, all with their own RigidBody, Colliders and ConfigurableJoints.
So I’m asking this:
Do many RigidBodies impact the performance too much?
Would it be better to just child the objects to one GameObject with a RigidBody?
Or said otherwise:
Are Compound Colliders noticeably better than Jointed RigidBodies?
Specific example: Imagine a statue/car/whatever structure made of hundereds of small 1x1x1 blocks, occasionally a special part, like a piston. All blocks have their own non-kinematic, gravity-enabled RigidBody, at least one non-trigger Collider (and several trigger ones), and each block would be joined to its neighbours with a ConfigurableJoint with Fixed movement and rotation.
Would it be better to leave it this way, or should I make an extra GameObject with a RigidBody to hold all these objects as children without their own RigidBody and with no Joints, essentially creating a compound collider?
I didn’t find a satisfactory answer online yet. I know that premature optimization is bad, but deciding about this early would save a lot of changing afterwards. When I realize that the game is slow, it might be too late to simply rewrite the thing.