playMaker

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

1982

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

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #1 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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

1982

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

foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #3 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?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #4 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.

Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #5 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! :)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #6 on: March 05, 2015, 12:04:34 PM »
Cool! Thanks for the feedback =)

Are you on Windows or Mac?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

ClintonReddie

  • Playmaker Newbie
  • *
  • Posts: 7
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #7 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.

1982

  • Junior Playmaker
  • **
  • Posts: 71
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #8 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.


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #9 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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #10 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

foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #11 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?

1982

  • Junior Playmaker
  • **
  • Posts: 71
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #12 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.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #13 on: March 05, 2015, 04:18:25 PM »
I suppose that is a suitable alternative.

What GPU do you have?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
Re: "Set Mouse Cursor" is broken in Unity 5
« Reply #14 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