Make Body go limp after dead

Ok, so I’m workin and an fps survival type game. I have a healthh script and when my health < 0 it call a “Dead” function and will destroy game object.

How would I script it to go limp (Like ragdoll?) fall to the ground according to physics and the destroy object(on a timer?)

I kind of have an idea but I’m still learning Javascript in Unity.

function Dead()
{
	Debug.Log("Im Dead");
	//destroy enemy
	Destroy(gameObject);
}

So for the ragdoll: You have to create a ragdoll replacement for your Gameobject. To do that you can use the ragdoll wizard ( Unity - Manual: Create a ragdoll ).

To destroy the replacement you attach a script to the ragdoll containing something like this:

var destroyTime : float = 10.0f;

function Start(){
Destroy(gameObject, destroyTime); //Not quite sure if it really uses a float or an int.
}

Then if you call Dead you destroy your current “alive” Gameobject ( or move it somewhere or deactivate it whatever suits your purpose ) and Instantiate the Ragdoll at the position and with the rotation of the “alive” GameObject.

Hope it helps.