Cursor.lockState locked and unlocked with one key unityy code example Example: unity mouse lock Cursor.lockState = CursorLockMode.Locked;