I have this script attached to my project. It's working but not fully. When i've paused the game once then unpaused it, It cannot be turned on and off again. Is there any way to make this script work permanently?
private var pauseToggle : boolean;
function Start () {
pauseToggle = false;
}
function Update () {
if (Input.GetKeyDown(KeyCode.Escape)) {
if(pauseToggle) {
Time.timeScale = 1;
}
else {
pauseToggle = !pauseToggle;
Time.timeScale = 0;
}
}
}
Would be great with a quick answer, Up-Vote awaits! :)
Omg, thats true -.-' Now i got annoyed by myself! How could i've missed that... However, the script is working now. Thank you very much Marowi! Up-Vote ;)
– anon9718537