Hi guys, so I want the cursor to be locked to the center of the screen where the crosshair is. If the player gets killed it will take them to a replay/exit scene, the problem is that when they’re taken to this scene (which the script isn’t in, so it should no longer be active) the cursor is still locked, this means that the player can’t make the choice weather to Replay or Exit and they’re stuck, any suggestions?
Cursor Lock Code:
// lock at beggining
function Start ()
{
Screen.lockCursor = true;
}
//unlock in mid game
function Update()
{
Screen.showCursor = false;
if (Input.GetKeyDown(KeyCode.P))
if (Screen.lockCursor)
Screen.lockCursor = false;
else{
Screen.lockCursor = true;
}
}