Screen.showCursor = false; Depends on X coordinate of mouse.

When I hide the cursor using Screen.showCursor = false, the cursor still shows while the mouse is on the right side of the game window. If I move the mouse back and forth it always appears slightly to the right of the middle of the screen and disappears when I move it back to the left side.

No further assignments to Screen.showCursor occur during that.

What is happening and how do I properly hide the cursor?

EDIT: I just realized it only happens while debugging in the Unity editor. If I run through a browser the cursor is hidden properly.

1 Answer

1

Sounds weird, but as a workaround, you could use lockCursor.

Not viable - I'm trying to hide the cursor while using mouse to drag objects around.

–

The problem could be the resolution. Is it possible that your selected resolution is less than the resolution you test/play the game at? [This][1] might help in figuring that out. [1]: http://answers.unity3d.com/questions/407357/play-at-specific-screen-resolution.html

–

Nope - the resolution is the same 960x720 everywhere. However, turns out this only happens while debugging in Unity editor.

–