- Home /
Pause menu
Hi, i am trying to develop a game in unity. For that game i designed a pause menu, even pause menu appearing on touch fire is running in background how can i solve this problem.
Answer by Seth-Bergman · Mar 12, 2013 at 05:11 AM
Usually, the easiest way to make most stuff in the scene pause is by setting the time scale to zero:
Time.timeScale = 0;
(and to turn back normal):
Time.timeScale = 1;
anything that still moves after that, you would need to create additional code for:
var paused : boolean;
function Update(){
if(paused == false){
//any code goes in here
}
}
this way when you pause, you just set the var "paused" to true, that way nothing happens
that's a very tidy idea Seth, I never thought of it and have never seen it!
i mean looking at a flag inside update.
thanks a million for that !
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
touch position to world position 2D 2 Answers
Animation Problems 1 Answer