You can pause your game in Unity3D by changing the rate at which the time is passing. It is very helpful in making pause menu in the game and in various situations that require pausing of all the events and physics to stop at the moment.
To pause your game you can use Time.timeScale property. This property should be set to 0 to pause everything in the game and 1 to UnPause.
Time.timeScale = 0; // To Pause
Time.timeScale = 1; // To UnPause
This has many interesting effect, for example if you use 0.5 instead of 1 you can slow down time.
Hope it helps.
0 Comment(s)