Hello,
I just started learning javascript and unityscript today,
and i tried to make my own script. So, what i want
to do: When you press the key (Tab) the mouse will unlock
from the center, will be visible and you will be able to move mouse without
moving the camera.
My Code(please tell me where i have bugs):
function Start (){
Screen.showCursor = false;
}
function Update () {
if (Input.GetKey (KeyCode.Tab))
Screen.lockCursor = false;
Screen.showCursor = false;
}
else
Screen.lockCursor = true;
Screen.showCursor = true;
}
}
Yes i know in the code i don’t have the lock camera function.
I don’t know how to do that
This script will be use to drag items.