If Dead, is there a function of stop all other mechanic?

If my character dead, I want to disabled all other mechanic like shooting skills, moving, hitted, and so on.

Of course isdead boolean and ! and if can achive this.

But it need modify all the functions.

Is there a simple solutions?

if(dead==true){
//do something
}

What do you have in mind?[/quote]

Ragdolls are probably what you are looking for. It’s explained in the FPS tutorial.

http://unity3d.com/support/resources/tutorials/fpstutorial

The concept is to replace the object you want to disable with another object that looks the same but does not have the same scripts attached to it.

For example you have 2 gameObjects of the player. One that has all the scripts for attacking, moving attached to it while the other is just the shell.

When the player dies, you destroy the player and replace it with the “shell” version which does not have the scripts on it, thus “disabling” everything.

You are genious!