isKinematic = true in child RigidBody works for movement but not physics

Hi folks!

This is driving me crazy so hopefully someone has an answer or workaround I can use.

I have 2 objects in unity that I need to parent. They both have rigidBodies.

I have followed the suggestions to set the isKinematic property to true on the child. This works for movement but doesn’t seem to work for physics as the child object goes trough walls or the floor and only stops when the parent (who is non-kinematic) hits the floor.

I’ve attached a couple of pictures of the behaviour and what I need. As you can see when the bottom block has kinematic true it goes trough the floor (grid). I need it to respect the floor as the second image indicates similar to the side blocks which I’ve just removed the rigidbody to test if that would work in a child object.

I can’t remove the rigidBody and re-add because another complex script depends on it which I am disabling when making the object the child but need to re-enable if I unparent it.

Any other alternatives I have to get the child object to respect the physics without removing the rigid body?

Thanks again for any help you can provide!

Actual

As a general rule, attaching a RigidBody to a parent and a child object is not a good idea and there is a better solution out there.

In your case, you can have both RigidBodys at the same level in the hierarchy and attach a FixedJoint or a SpringJoint to imitate parenting behaviour while keeping realistic physics.