Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: 1982 on March 04, 2015, 11:25:53 AM

Title: "Set Mouse Cursor" is broken in Unity 5
Post by: 1982 on March 04, 2015, 11:25:53 AM
I already sent official bug report of this and Playmaker staff is looking into it.

I just wanted to know if there are people with this same problem, and if you have solution for it?

What happens is that cursor locking doesn't work anymore (Win, PC). Hiding does work but locking don't. It is the same in editor and in build. It makes my other bug testing quite difficult as I can't play the game bcause mouse cursor is always in the wrong place :D
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: Lane on March 04, 2015, 12:50:45 PM
This is correct.

Screen.showCursor is depreciated, but Unity API Updater should have caught it. Probably because of the way its wrapped in a Playmaker function it missed it.

I'll make a new action that directly uses the Unity API today.
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: 1982 on March 04, 2015, 01:16:16 PM
Great, thanks!
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: foxdeltagames on March 05, 2015, 11:40:12 AM
How do I make a action that uses the new Unity API to lock and hide the mouse?
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: Lane on March 05, 2015, 11:54:39 AM
Give the attached action a try.

I'm getting mixed feedback on using the Visibility flag, it doesn't work in my tests but others report it fine.. Let me know.

Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: foxdeltagames on March 05, 2015, 11:59:02 AM
Give the attached action a try.

I'm getting mixed feedback on using the Visibility flag, it doesn't work in my tests but others report it fine.. Let me know.


Its working for me, just fine.

All i did it just drag and drop the C# script to the actions folder located in the playmaker folder in my project.

Thanks a ton for this action! :)
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: Lane on March 05, 2015, 12:04:34 PM
Cool! Thanks for the feedback =)

Are you on Windows or Mac?
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: ClintonReddie on March 05, 2015, 12:06:06 PM
Thanks for this, it's a huge help. Solves a longtime problem. Working fine for me on Windows.
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: 1982 on March 05, 2015, 02:35:57 PM
Thanks, a lifesaver!

For me hiding does not work, unless I set the cursor texture to transparent texture and use a "Force Software". (Win PC, 64bit editor and 32bit game builds).

Also alt+tabbing and coming back to game, loses control of the cursor. But I think I can override that issue by resetting the action once in a while.

Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: Lane on March 05, 2015, 02:42:11 PM
Interesting. Thanks for letting me know.

In regards to tabbing out, I think this might be something that you have to capture on your own. Maybe we should add an every frame option here, but probably need to run some tests to see how the system actually handles these events now. Currently in a window or web build you can hit escape to free the cursor so the only real answer to that is to do it every frame so it reverts when they return, or see if we can capture the system event and set the correct Cursor Modes again.
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: foxdeltagames on March 05, 2015, 03:15:42 PM
Cool! Thanks for the feedback =)


Are you on Windows or Mac?

I'm using windows 7 64 bit. One thing to note the mouse does not hide propertly when playing in the editor NOT in full screen.

I noticed that if you set to game mode window to full screen the mouse will disappear.

Also if you make a game build and play in full screen. The mouse does disappear. I have not tried playing the build in window mode. I'll let you know when I do
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: foxdeltagames on March 05, 2015, 03:17:20 PM
Thanks, a lifesaver!

For me hiding does not work, unless I set the cursor texture to transparent texture and use a "Force Software". (Win PC, 64bit editor and 32bit game builds).

Also alt+tabbing and coming back to game, loses control of the cursor. But I think I can override that issue by resetting the action once in a while.

I'm sure you tired to click on the game mode window to see if it centers right?
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: 1982 on March 05, 2015, 04:16:48 PM
I'm sure you tired to click on the game mode window to see if it centers right?

It centers all right, it just doesn't hide correctly. But I've made fix for it using transparent/empty texture for cursor.
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: Lane on March 05, 2015, 04:18:25 PM
I suppose that is a suitable alternative.

What GPU do you have?
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: foxdeltagames on March 05, 2015, 04:26:57 PM
I suppose that is a suitable alternative.

What GPU do you have?


I'm using a Nvidia GTX 570
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: 1982 on March 06, 2015, 07:56:20 AM
I suppose that is a suitable alternative.

What GPU do you have?

Radeon R9 270X
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: stigma on March 08, 2015, 06:24:07 AM
Hi,
I have the same problem. I put the script in the action file playmaker but it does not work. I deleted and then re action without result. Help me please.
Thks

Edit:
It's ok with that
(http://www.maximages.fr/forums/3D/playmaker/setmousecursor.jpg)
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: N00basaurus on April 28, 2015, 10:21:14 PM
Give the attached action a try.

I'm getting mixed feedback on using the Visibility flag, it doesn't work in my tests but others report it fine.. Let me know.

The action doesn't work for me.

I work on two monitors, so when it locks the cursor, it chooses a monitor at random and centers the cursor to the that monitor, but does not lock it. 

It also doesn't hide the cursor eitehr.
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: stigma on May 01, 2015, 02:32:54 AM
PlayMakerGui in Inspector was broken
Title: Re: "Set Mouse Cursor" is broken in Unity 5
Post by: gheeDough on October 13, 2015, 05:44:10 AM
Works for me no on a Mac on Unity 5.2.1  :D