how to lock the cursor in unity game code example
Example: how to unlock cursor in unity
Cursor.lockState = CursorLockMode.None; // to unlock cursor
Cursor.visible = true; // to make cursor visible
Cursor.lockState = CursorLockMode.None; // to unlock cursor
Cursor.visible = true; // to make cursor visible