x


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

more ▼

asked May 02 '11 at 12:35 AM

MrSplosion gravatar image

MrSplosion
132 45 52 61

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

1 answer: sort voted first

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.

more ▼

answered May 02 '11 at 12:49 AM

Joshua gravatar image

Joshua
6.4k 19 25 70

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.

May 02 '11 at 01:19 AM Joshua
(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:

x485
x88
x21

asked: May 02 '11 at 12:35 AM

Seen: 2289 times

Last Updated: May 02 '11 at 12:35 AM