- Home /
how can i disable mouse cursor?
how can i disable mouse cursor?
Answer by Sibz9000 · Mar 10, 2019 at 01:32 PM
Visibility
While disabling the cursor isn't really possible, it can be made invisible.
This can be done with the following code:
Cursor.visible = false;
Locking
Another method, that has a side effect of making the cursor invisible, is to lock the cursor to the center of the screen, this can be ideal when using mouse input for pan/tilt or pitch/yaw type controls, i.e. camera pan/title or spacecraft movements
Cursor.lockState = CursorLockMode.Locked
More info, including different lockstates and how to use a custom cursor, can be found here: Unity - Scripting API: Cursor
Answer by Doireth · Jan 17, 2013 at 05:49 PM
http://docs.unity3d.com/Documentation/ScriptReference/Screen-showCursor.html and/or http://docs.unity3d.com/Documentation/ScriptReference/Screen-lockCursor.html
showCursor show/hides the cursor while lockCursor prevents the cursor form leaving the window.