My OnCollisionEnter function is called on a child only if the parent object does not have a rigidbody. Why?

I have a character that can shoot bubbles onto walls. When the player runs into the bubbles, she bounces off them with a script on the bubble that uses OnCollisionEnter.

When I shoot the bubble, I parent it to the collider.transform that it hit, so that way, if there is a moving wall or something with another rigidbody on it, the bubble will move with it.

This works if the parent does not have a rigidbody. The OnCollisionEnter function is not called if the parent also has a rigid body. Why is this, and how can I get around it?

You’re probably running into a situation where your new child is considered a part of a compound collider for the parent object. See the manual on rigidbody for what that means. I thought that shouldn’t happen if the child had it’s own rigidbody, but I might be wrong.

Try putting the bubble on a different layer from the ones it is colliding with, that should prevent the compound-ness.