hey i have a script that locks the mouse i need the script to turn off when i press escape then turn back on when i re press it, the escape button is what gets me into the menu… the script i have it… any ideas?? or re writes to it… to fix my issue
function Update () {
Screen.showCursor = false;
Screen.lockCursor = true;
Screen.lockCursor = false;
}
var paused : boolean = false;
function Update ()
{
if(Input.GetKeyDown("escape")
{
paused = !paused ;
if(paused) //Do Stuff When Paused
{
Screen.showCursor = true;
}
else // Do stuff when unpaused
{
Screen.showCursor = false;
}
}
}