Can I detach child objects from their parent?

I have a GameObject with a ragdoll as the child. The ragdoll is set to activate when the players health sets to 0. The only problem with that is that when the ragdoll activates, it is still a child of the parent with has had active set to false. The ragdoll will just stay in mid air. Is there a way for me to detach the ragdoll from it’s parent while still keeping the ragdolls rigidbodies together?

Take a look at this and this great post by Fattie.

Fixed, I used transform.DetachChildren();