- Home /
Lock Cursor in the Center of the Screen?
I'm making a mouse look script and the only thing wrong with it is the cursor. I know you can use Screen.lockCursor to lock it but I have know idea how to put it in the center of the screen. Thats it, I just want to know how to force the cursor in the center of the game window.
Thanks
Answer by Joshua · May 02, 2011 at 12:49 AM
Screen.lockCursor is a combination of hiding the cursor (Screen.hideCursor) and setting it in the middle of the screen. So it already does what you want :). I'm not away of a way to do it any other way.
A problem I have actually been having myself is that it seems it's not possible to directly alter the mouse's position other then using lockCursor.
Your answer
![](https://koobas.hobune.stream/wayback/20220613130744im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
C# Physics.SphereCast Center of Screen 2 Answers
How can i move an object while the coursor is locked? 1 Answer
How to always have the mouse curser in the center of your game ? 3 Answers
Cursor not locking to center 0 Answers
Aiming to center 0 Answers