|
hi guys i have a game manager script that i manage to pause the game when my player collide with an object by using Time.timescale but is there a alternative ways that i can pause only the timesystem and the game continue running if not then pause the game but the timesystem contiune running? gamemanager.js function Update(){ //if(isPaused == false){ if(!Paused){ Paused=false; } else { Time.timeScale = 0; Paused=true; } if(Input.GetButtonUp("Jump")){ Time.timeScale = 1; Paused=false; function OnGUI () { Debug.Log("OnGUI"); restSeconds = countDownSeconds - (guiTime);
(comments are locked)
|
|
I don't think there is other way to pause the default time system without using Time.timeScale. However, if you make your own time countdown or something else you can pause them. You can make a boolean to check if a pause button is pressed or not. If it is, then stop your script from subtracting the number of time.
However if you want the game paused but the time continues ticking. Then you can disable all the components that you want to stop except the time by using this line of code gameObject.GetComponent ("name-of-the-script").enabled = false; Hope this helps. Good Luck! You can stop all your scripts that way, but be warned that this won't actually pause your game. For instance, if you have any objects with rigidbodies they will continue to move under physics.
Sep 29 '11 at 01:48 AM
Julien.Lynge
I agree!!!
Sep 29 '11 at 02:18 AM
henry96
(comments are locked)
|

I think you misunderstand timescale. Timescale is the speed that time passes within your game - it is intrinsic to the game itself.
What exactly are you trying to do, and why isn't changing the timescale working for you?