playMaker

Author Topic: "Set Mouse Cursor" is broken in Unity 5  (Read 5960 times)

1982

  • Junior Playmaker
  • **
  • Posts: 71
    • View Profile
"Set Mouse Cursor" is broken in Unity 5
« on: March 04, 2015, 09: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
« Last Edit: March 04, 2015, 09:28:06 AM by 1982 »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #1 on: March 04, 2015, 10:50:45 AM »
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.

1982

  • Junior Playmaker
  • **
  • Posts: 71
    • View Profile
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #2 on: March 04, 2015, 11:16:16 AM »
Great, thanks!

foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
    • View Profile
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #3 on: March 05, 2015, 09:40:12 AM »
How do I make a action that uses the new Unity API to lock and hide the mouse?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #4 on: March 05, 2015, 09: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.


foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
    • View Profile
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #5 on: March 05, 2015, 09: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! :)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #6 on: March 05, 2015, 10:04:34 AM »
Cool! Thanks for the feedback =)

Are you on Windows or Mac?

ClintonReddie

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #7 on: March 05, 2015, 10:06:06 AM »
Thanks for this, it's a huge help. Solves a longtime problem. Working fine for me on Windows.

1982

  • Junior Playmaker
  • **
  • Posts: 71
    • View Profile
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #8 on: March 05, 2015, 12: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.


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #9 on: March 05, 2015, 12: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.

foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
    • View Profile
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #10 on: March 05, 2015, 01: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

foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
    • View Profile
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #11 on: March 05, 2015, 01: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?

1982

  • Junior Playmaker
  • **
  • Posts: 71
    • View Profile
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #12 on: March 05, 2015, 02: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.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #13 on: March 05, 2015, 02:18:25 PM »
I suppose that is a suitable alternative.

What GPU do you have?

foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
    • View Profile
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #14 on: March 05, 2015, 02:26:57 PM »
I suppose that is a suitable alternative.

What GPU do you have?


I'm using a Nvidia GTX 570