when i hit the play button (Ctrl+P) the cursor stock at my game screen how do i back it to normal that when i click play the cursor will not show in game? anyone please help, i think i press some key to make it happen
1 Answer
1You need to add the correct line in your script:
//For showing the cursor, there is:
Cursor.visible = false; //true or false, self explanatory
//For locking the cursor there are 3 modes:
Cursor.lockState = CursorLockState.None; //Doesn't lock the cursor so you can select outside the window
Cursor.lockState = CursorLockState.Confined; //Makes it so the cursor cannot exit the game window
Cursor.lockState = CursorLockState.Locked; //Cursor is locked to the center of the screen.
Also if you ever lock your cursor and need to make it visible again for a little bit you can press ESC and it will unlock and show your cursor. This only works in the editor, however.