I am working on a First Person horror game, and I want to make a simple pause script, but I am having some problems. The script works, but I can still look around when this is paused. I am just using the default Unity First Person Controller, so there are several scripts controlling mouse look, character motor, etc. Does anybody know how I could disable looking around when I “pause”? Here is my script, so-far:
var paused : boolean = false;
function Update () {
if(Input.GetKeyUp(KeyCode.Escape)){
if(!paused){
Time.timeScale = 0;
paused = true;
MouseLook.enabled = false;
}else{
paused = false;
Time.timeScale = 1;
}
}
}