Hey, I added this script to my game and built in in standalone pc format but I can't get my cursor visible when I push escape or P... anyone maybe knows why? do I haft to do something more than just add the script?
Do I haft to do something in Input Manager?
private var shouldPause : boolean = false; private var isPaused : boolean = true;
function Update () {
if(Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.P)) {
shouldPause = !shouldPause ;
}
if(!shouldPause && isPaused ) {
Screen.lockCursor = true;
Time.timeScale = 1;
isPaused = true;
}
else if(shouldPause && !isPaused) {
Screen.lockCursor = false;
Time.timeScale = 0;
isPaused = false;
}
else if(!Screen.lockCursor && !shouldPause) {
shouldsPause = true;
}
}