How to make ragdolls activate when clicked

Hello, i am trying to make ragdolls turn on when clicked, but i dont know how to do this. I have ragdoll already but script for turning on ragdoll doesnt works.

Ragdolls should just work (fall to ground) as default. The ragdoll creator will add a collider and a Rigidbody to each limb automatically and in order to get is to stand at play time you would need to make it kinematic. Other wise the ragdoll object will just fall to the ground. Do have the rigibodies marked as kinematic right now? If so just make them non Kinematic when “clicked” and the characters will fall naturally.

Another method is to just spawn the ragdoll “prefab” in the same pose as the animated regular character. Then just turn off the regular character.