Rigidbody inertia recalculation after detaching child colliders ?

Hi,

if I have an object which is a rigid body and contains a sphere collider and has 2 children. The children are no rigid bodies but both contain a box collider. I hope this is a valid way to combine multiple colliders reffering to one rigid body.

Now I want to detach a child(the collider). My question is: Is it enough to simply call childObject.transform.parent = null ? Which kind of impact does this have on my rigid body ? Does it know about the change ? Or does it still think that there is collider.

I guess that the rigid body does not recalculate the inertia which is necessary after changing the collider set.

Soo… are there better solutions or are there methods like “recalcInertia” ?

Regards,
Chris

I have now examined the effects of detaching a gameobject from its parents via debugging and retrospection. After the call to

gameobject.transform.parent = null;

the rigidbody of this gameobject will be reset automatically. First the mass to 1.0f, then other rather meaningful values for inertia and center of mass. Administrative values like constraints stay. So don’t forget to finish your rigidbody setup after detaching from the parent.
Another interesting behavior happens with its parent. Mass of rigidbody does not change. Although inertia and center of mass automatically do.
In my setup I used objects with colliders or a hierarchy of colliders respectively. (Unity 4.2).

Unity3d does recompute all the rigidbody parameters on reparenting.