Hello, do you know if it is possible for the mouse to be hidden while playing a Unity game even when it’s outside of the game window?
You actually want to use Screen.lockCursor then. If you set showCursor to false it will only affect the visibility on the Unity window. When the cursor is outside of the game window and the user clicks, your game will loose the focus, so it makes no sense to “hide” it outside of the game window.
You want to lock the cursor so it can’t leave the gamewindow. However that will freeze the cursor at the windows center. If you need a mouse cursor inside your gamewindow, you can display a GUITexture as cursor and use the mouse delta to move it:
var xDelta = Input.GetAxis ("Mouse X");
var yDelta = Input.GetAxis ("Mouse Y");
I guess you could not handle the cursor outside the game window through unity…
You can hide it only inside Unity game window.
Have a look at,
Locking the cursor - Screen-lockCursor