HI! im new here and still learning UnityScript. But i have a Problem.
I have a script that Pause the game and Unlock the Mouse. But when i Resume. The Mouse is still Unlocked! any Ideas?
Script:
private var pauseEnabled = false;
function Start(){
pauseEnabled = false;
Screen.lockCursor = true;
Screen.showCursor = false;
}
function Update(){
if(Input.GetKeyDown(“escape”)){
if(pauseEnabled == true){
pauseEnabled = false;
Screen.lockCursor = true;
Screen.showCursor = false;
}else{
if(pauseEnabled == false){
pauseEnabled = true;
Screen.lockCursor = false;
Screen.showCursor = true;
}
}
}
}