void Start () {
Screen.lockCursor = false;
Screen.lockCursor = true;
}
// Update is called once per frame
void Update () {
if(Input.GetKeyUp(KeyCode.Tab))
{
Screen.lockCursor = !Screen.lockCursor;
}
}
Such a simple code and it doesn’t work. I attached it to an empty GO inside the scene. The problem seems to be that the cursor locks in wrong place (an afaik it should lock in the middle of the screen) - when I hit tab for the first time I can see it’s location and it’s usually somewhere far right - after that when I hit tab, everything is back to normal, so the problem seems to appear only on level startup. Any thoughts?