|
I've been looking at answers, and I don't understand them. All I want is a script that will lock the cursor at the center of the screen for a stand-alone game. Just one script, NOTHING ELSE.
(comments are locked)
|
Press and hold escape to unlock the mouse.
(comments are locked)
|
|
I've been looking at threads about this problem and haven't found an easy enough answer, so I thought I'd add my two cents: It's not a perfect solution bot for prototyping purposes I use this: Screen.lockCursor moves the pointer to the center of the screen, so it does almost exactly what the OP suggested - resets the cursor every frame. You could also use a MouseMove event for example :) Not very clean but it does the job, you retain OnMouseDown functionality, the cursor remains visible.
(comments are locked)
|
|
Hello. I needed what you want during a testing proyect. I used "Screen.lockCursor" to block the cursor in the center of screen to simulate the pointer of a gun. Here you have the API example: ScreenLookCursor I hope its what you want. See you.
(comments are locked)
|

Except for the simplest of things, it rarely works to simply drop a script into a project and have it do what you want, and your request is non-trivial. You're probably best off studying people's proposed answers to see what might work best in your situation, and perhaps finding a programmer friend you can talk to face to face to explain some of the more intricate details.