I meant Time.timeScale in title --sorry
OK you can see the below script and this has worked in the past to pause a game. Since I have upgraded to 3.4 it seems Time.timeScale only effects the script that you change it in. For example if I print(Time.timeScale) from this script I get 0 as expected when I hit pause button. However if I print print(Time.timeScale) from any other script I get 1 wether I hit pause button or not – am I missing something? Shouldn’t Time.timeScale effect all active scripts?
#pragma strict
var paused : boolean = false;
var pauseToggle : int;
function Awake(){
useGUILayout = false;
}
function Update () {
if(pauseToggle == 1){
if(!paused){
Time.timeScale = 0;
paused=true;
}
}
else{
Time.timeScale = 1;
paused=false;
}
}
function pauseGame1(){
if (pauseToggle != 1){
pauseToggle = 1;
}
else{
pauseToggle = 0;
}
}