- Home /
how to make the cursor ACTUALLY lock
no cursor locking iv ever tried, or cursor visibility has ever done anything for me.. do they just not work when i'm running the game through unity, do they only work on full builds?
cursor visibility only lasts until i move the mouse or click or something then it unhides. locking just plain never does anything. iv tried code from them all in start and update functions. i don't really have any specific code here because iv tried the various commands many times. back in unity 4 i used Screen.lockCursor and Screen.showCursor. and now in unity 5 Cursor.lockstate, and Cursor.visibility and nothing works and its starting to get on my nerves.
i currently have this:
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Confined;
in the Update() function of my player and the only thing that happen is if im holding mouse 1,2, or 3 the mouse will disappear while in motion. i can still move the cursor out of the game window.
Your answer
Follow this Question
Related Questions
Cursor unlocking on player 1 Answer
Standalone problem with cursor 2 Answers
Cursor not working after changing scene 1 Answer
What am I doing wrong in this 1 Answer
Locking the mouse cursor without it centering after unlocking it? 0 Answers