- Home /
How can i move an object while the coursor is locked?
I have an object that follows the mouse position(x,y) and works perfect until i lock the cursor which then just sits in the center of the screen. I need the object to move based on the x,y coordinates of the mouse while the cursor is locked, any ideas would be awesome.
Answer by Tetrad · May 03, 2010 at 09:58 PM
You don't want to lock the cursor, you just want to hide it.
Use Screen.showCursor = false;
http://unity3d.com/support/documentation/ScriptReference/Screen-showCursor.html
I need to lock it so the cursor stays inside the game window, it's for the web player.
Well what most games do is manually lock the cursor by checking for deltas then resetting the cursor position. Unfortunately I don't see any way to set the cursor position from script.
Your answer
Follow this Question
Related Questions
Lock Cursor in the Center of the Screen? 1 Answer
Is it possible to lock a cursor without hiding it?? 0 Answers
Player to look at 0 Answers
Lock cursor on the center of screen 3 Answers