- Home /
Cursor " Hide" is not Immediate, what's wrong?
Hi pals! I was browsing Scripting APIs to find the method to hide the mouse cursor/pointer, and found the deprecated one with Screen.
A note pointed me to the updated method, which is Cursor.visible = bool; nice enough!
But then, when I've implemented the line inside one of my scripts, an undesirable behavior continued to occur: the Cursor doesn't hide as soon as the game starts running, user has to click once for the cursor to disappear, which is not that elegant.
I've tried to write the line in Awake(), Start() and Update(), but the behaviour occurs nevertheless.
Here's a sample of my code:
void Start () {
//Since I'm not too fond of mouse cursor, I'm gonna hide it
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Confined;
}
Could it be that this behaviour shows up because I've modded the default cursor's texture inside player preferences instead of using Cursor.SetCursor()? Or that method has nothing to do with the problem? Is this an " editor only" behaviour maybe?
Thanks a lot for any clarification!
Your answer
![](https://koobas.hobune.stream/wayback/20220611231557im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Hide and lock the mouse cursor (beginner) 0 Answers
Hiding a Cursor? 3 Answers
Hide mouse cursor on startup 2 Answers
How to stop mouse getting out of the game, my game is in webplayer? 2 Answers
Pause menu script, mouse not hiding 1 Answer