Quantcast
Channel: Latest Questions by esitoinatteso
Viewing all articles
Browse latest Browse all 92

Cursor " Hide" is not Immediate, what's wrong?

$
0
0
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!**

Viewing all articles
Browse latest Browse all 92

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>