Moving rigidbody child colliders

Does moving child colliders in a compound collider incur in a performance penalty, even if the center of mass is manually set?

-Parent with non-kinematic rigidbody and collider
-Child Collider
-Child Collider (moved by code locally)

I want to avoid using joints because of their complexity and fickleness, as I just want to move the child in a very specific way. And I need the parent rigidbody to react to collisions against the moving child collider.

I’ve been after a similar functionality trying to get the equivalent of heavy friction joints where external collisions don’t affect the relative trajectory of joint pieces (but does affect the trajectory of the body as a whole). Unfortunately this is not currently possible. These are the two closest solutions and their pitfalls:

  1. Use kinematic rigidbodies for child joints.
    Pitfall: Collisions with child joints won’t change the main body physically.

  2. Move child colliders with code as you suggest.
    Pitfall: The local movement does not register with the physics engine so inaccurate physical results occur where objects penetrate more than they should or exit out unrealistically. Small/slow rotations (or somehow stopping movement when a collision is close to happening) are mediocre workarounds. Really only works for situations where something rarely moves and is unlikely to collide during that movement.

For performance, I’ve been meaning to test the cost of this but haven’t gotten around to it. I do believe there will be some collision data calculations whether or not you set the center of mass but that should at least stop the center of mass calculation, saving you some. Any performance data you end up finding would be helpful :wink: