|
How can i set mouse cursor position?
(comments are locked)
|
|
in mono you can use the system.windows.form.cursor.position but it needs the windows.form.dll and you need to add this assembly to your project. for mouse clicks you should use external APIs witch are in user32.dll but i don't know anything about OSX. in web players you can use javascript to do mouse movement and click. note: you can not use external native code in web players. how do you add this assembly to your project? I referenced it in mono, but it keeps dereferancing when I compile in unity?
May 17 '11 at 08:58 PM
michael 4
(comments are locked)
|
|
I don't think it's possible to directly set the mouse cursor position with Unity's own API (although it's likely possible if you use a custom DLL in a standalone build). However, if your goal is to set the mouse cursor position in order to achieve a "mouse look" effect, there's a lockCursor command to do just this.
(comments are locked)
|
|
You can work around this problem, by basically manually implementing a GUI based mouse and moving it through the mouse delta given by Unity. You could then set the position of this mouse and just use static variables to access it from every script. Wish unity would fix it, so we don't have to do these stupid workarounds.
(comments are locked)
|
