pausing feature

how can i make my game pause, i want it to pause when i press the "p" button and to un-pause when i press "p" again and there to be a pause menu. thanks

It's been asked and done before. Here's how you can pause the game with p. Note that this only pauses time driven behaviour. Optionally you can also set a static variable called "paused" that you can test for in your scripts to block execution.

While it is paused you can display a GUI with the buttons or options you want to have. There is a special callback called OnGUI you can make use of.

You can also take a look at unify wiki scripts. I found a complete pause menu script there.

See:

When timeScale is set to zero your
application acts as if paused if all
your functions are frame rate
independent. Negative values are
ignored.