Godot Version
Godot 4.4.1 Stable
Question
Hello!
I am wondering if a Rigidbody3D that has children Rigidbodies (frozen, for example as attachments) behaves as if it has the mass of itself and all of it’s children, or if it behaves as the mass entered by the user.
For example, if you had a gun with a mass of 3kg, and it has a child that is a magazine with a mass of 0.5kg, would the gun behave as if it had a mass of 3.5kg or 3kg?
No RigidBodies only account for their own mass. I’d recommend against childing any RigidBody to another as the child moves with the parent regardless of physics, for example if the parent falls due to gravity the child will fall due to gravity and it’s parent’s falling transform resulting in not only twice as fast gravity, but phasing through floors as the parent’s transform doesn’t account for collision.
1 Like
Right, ok that makes sense. So (for the above example) if I wanted them to have separate physics behavior when separated, maybe the right thing to do is for the weapon & the magazine to each be a Node3D with a mesh & collision. Then whenever the magazine is separated from the weapon (and any other parent), we create a new Rigidbody3D copying it’s transform, add the magazine & it’s components to it as children, and assign the mass to the Rigidbody.