Hi all! I have a very simple problem and I’m not asking for code. I have a pause game script (below) and I have a tiny issue. Everything stops, but the player can move the mouse look camera around while paused. Is there any way I can lock the mouse look script while paused?
var paused : boolean = false;
function Update () {
if(Input.GetKeyDown(KeyCode.P)){
if(!paused){
Time.timeScale = 0;
paused=true;
}else{
Time.timeScale = 1;
paused=false;
}
}
}
Untested suggestion: Just add the following line to the top of Update() in the mouse look script. if (Time.timeScale < 0.01) return;
– robertbu