x


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.

more ▼

asked May 02 '10 at 11:51 PM

ThumbStorm gravatar image

ThumbStorm
418 27 33 42

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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

more ▼

answered May 03 '10 at 09:58 PM

Tetrad gravatar image

Tetrad
7.2k 27 37 89

I need to lock it so the cursor stays inside the game window, it's for the web player.

May 03 '10 at 11:31 PM ThumbStorm

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.

May 04 '10 at 04:41 PM Tetrad
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x477
x327
x21

asked: May 02 '10 at 11:51 PM

Seen: 1317 times

Last Updated: May 03 '10 at 04:38 PM