- Home /
Script that makes the mouse cursor invisible.
I would appreciate it if someone could show me what this script would look like. I want the mouse cursor to go invisible which activates/integrates the mouse in the game. But when you would like to exit, you press the button which goes to pause menu. Thank you so much!
well, you probably want this:
http://docs.unity3d.com/Documentation/ScriptReference/Screen-lockCursor.html
Answer by TheVectorHunter · Aug 13, 2012 at 02:01 AM
Use Screen.showCursor = bool; whenever you want the cursor to disappear.
http://docs.unity3d.com/Documentation/ScriptReference/Screen-showCursor.html
Answer by MoruganKodi · Feb 11, 2015 at 01:45 PM
For future reference. The above is still valid in Unity 4.x.x. However in Unity5 this changes.
In Unity5 'Screen.showCursor' is marked as Depreciated.
The replacement is 'Cursor.visible = false';
Answer by smthb · Aug 13, 2012 at 05:20 AM
Thanks guys!
This place is tricky to get used to, but you should only submit answers when it's actually answering the question. Otherwise use the 'add new comment' buttons. ;)
Your answer
Follow this Question
Related Questions
how to show cursor on specific time? 2 Answers
Making a Pause Menu 1 Answer
How do I make a pause menu? 3 Answers
Pause menu script, mouse not hiding 1 Answer
add lockcursor to pause menu script?? 2 Answers