Attaching Rigidbody breaks gravity

This question is specific I worry how much help I can get here, but… just in case.

I’ve constructing a flying cargo ship. It grabs a cargo box.

The flying ship flies by applying constant upward force. Flies great, everything there is golden.

The cargo container has all the things you might expect, a rigid body, mass, etc.

I attach the cargo container at a certain point using:

MyContainer.rigidbody.isKinematic = true;
MyContainer.transform.parent=MyShip.transform;

That works fine too, everything attaches, the ship flies around with the container.

The trouble is that somehow the ship no longer falls to the ground when the engines are turned off (almost as if gravity is completely removed). My suspicion is that the isKinematic setting of the container is messing up the physics of the ship somehow.

If I do not apply isKinematic=true, then the cargo container does not attach at all… which is strange considering that it becomes parented to the ship.

Again, I know this is specific and I’m not hiring you on, but I thank you even for reading this.

you’re right, it is very confusing, and as is often discussed on this list …

the specific combinations of what happens when one mixes different types of bodies, is sadly poorly or not documented in the Unity docs.

Just FTR my take …

  • in this situation never use iKinematic at all
  • the Box should have a rigidbody
  • possibly turn off gravity on the box when it comes a bord
  • likely disable the colliders on the box when it comes a bord
  • possibly set the Box mass to zero (well, low) when it comes a bord

Perhaps no use at all but my take !