I have this script, the actual locking of the cursor is fine, it stays in the center and doesnt move, however the hiding of the cursor appears to be hidden, but whenever you press ANY key on the keyboard, it flickers(probably for a single frame), and then it goes hidden again. However when you are playing an fps and you are constantly pressing buttons, it constantly flickers and flickers. Here is the script, am I doing something incredibly idiotic or is there an underlying problem?
//Locking the cursor
if(Input.GetMouseButtonDown(0)){
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
if(Input.GetKeyDown(KeyCode.Escape)){
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
}