- Home /
Screen.lockCursor mystery?
I'm using this simple code on my custom FPS character controller:
void Start() {
// Lock Cursor
Screen.lockCursor = true;
}
I just want the mouse cursor to stay frozen where it is (ie: always in the center of the screen). I can not understand why the above doesn't work. It has literally no effect on the mouse cursor, I get the same with or without it.
Answer by cubictoast · Dec 08, 2013 at 01:50 AM
Unity has a strange Bug where lockCursor refuses to work in the developer, but almost always works in the standalone/web version. Try building a standalone executable (or app, if on a mac) and try it from there. If it refuses to work there as well, try adding an update function to lock the cursor for OnMouseDown.
Your answer
Follow this Question
Related Questions
my mouse freezes when I hold down any key. 0 Answers
disable script when i press escape?? 2 Answers
Check if mouse cursor is locked 1 Answer
Mouse won't freeze in center of screen 1 Answer
Mouse Look Freeze on Pause? 1 Answer