|
Hello again everyone, I'm trying to make a pause menu for my game, and i have it done except for one thing, i can't get my resume game button to work. So the question here is how to i make it when i press the button, the GUI box closes and the timescale go back to normal? I've looked all over the scripting reference page but found nothing, help is greatly appreciated. -edit- Ok, heres my code(new code actually) which still doesn't work
(comments are locked)
|
|
It's hard to tell without seeing your existing code, but I would think it you would want something like this: Ah, got it working, thanks for the help
Nov 29 '09 at 07:14 AM
Will
(comments are locked)
|
|
This is how i did my pause in game. Hope it will help you. if(Input.GetKeyDown("p")) //checking if P button was pressed { if(Time.timeScale == 1) //if game was not paused it will pouse the game { audio.volume = 0.1; //making music volume in background to be lower print("Pause"); //for testing only Time.timeScale = 0; //pousing the game } else if(Time.timeScale == 0) //if game was paused it will start the game { audio.volume = 0.5; //making music volume in background to be louder print("Start"); //for testing only Time.timeScale = 1; // continuing the game } } even though you spaced it out so that it's kinda readable, you could format that so we can truely read it... just press the button with the numbers on it.
Dec 24 '10 at 01:22 AM
Jesus_Freak
(comments are locked)
|
