playMaker

Author Topic: Set Cursor not working [SOLVED]  (Read 6632 times)

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Set Cursor not working [SOLVED]
« on: November 06, 2013, 07:44:58 PM »
I have an FSM which, on start, is supposed to hide and lock the cursor. I'm using the "set mouse cursor" action. On start, both the "hide cursor" and "lock cursor" boxes are checked. However, sadly, the cursor is neither hidden nor locked when I start the game.

The idea is that when ESC is pressed, the cursor un-hides itself, and a menu appears. Hitting ESC again will return to the start state, hiding the menu and the cursor. The FSM is properly transitioning states, and displaying/hiding the menu, but no matter what, the cursor is always visible.

I'm hoping it's something simple that I'm just not aware of. Any ideas?
« Last Edit: November 10, 2013, 09:14:07 PM by Breadman »

uberwolfe

  • Junior Playmaker
  • **
  • Posts: 59
Re: Set Cursor not working
« Reply #1 on: November 06, 2013, 08:57:03 PM »
Have you got Control Mouse Cursor checked on your PlaymakerGUI in the hierarchy?

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: Set Cursor not working
« Reply #2 on: November 06, 2013, 09:01:34 PM »
Good thinking! I didn't know that box was there. I just checked and it was enabled. I tried disabling it, and the problem persists. It seems that enabled or disabled, nothing changes.

Just to be sure, I made an entirely new FSM on an empty object, with "set mouse cursor" action on it - doing this still won't hide the cursor. Wonder what's going on :/
« Last Edit: November 06, 2013, 09:04:20 PM by Breadman »

uberwolfe

  • Junior Playmaker
  • **
  • Posts: 59
Re: Set Cursor not working
« Reply #3 on: November 06, 2013, 09:07:41 PM »
Have you tried building the scene and seeing if it works then??

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: Set Cursor not working
« Reply #4 on: November 06, 2013, 09:10:43 PM »
Just tried building it, cursor still visible. I must be crazy or something haha.

uberwolfe

  • Junior Playmaker
  • **
  • Posts: 59
Re: Set Cursor not working
« Reply #5 on: November 06, 2013, 09:27:30 PM »
Hmmm, odd. I use pretty much the same setup as you describe except holding down the Alt key unlocks the mouse and it works flawlessly once the scene is built and run.

Not sure what's going on here :(

uberwolfe

  • Junior Playmaker
  • **
  • Posts: 59
Re: Set Cursor not working
« Reply #6 on: November 06, 2013, 09:42:01 PM »
One final thought, are you using any other extensions for your GUI?

If so, it might be hijacking the cursor...

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: Set Cursor not working
« Reply #7 on: November 06, 2013, 10:34:50 PM »
The only non-standard thing I'm using is "PauseController" by Eleckt Mobile. [http://u3d.as/content/eleck-tek/group-pausing-kit-pause-controller/2VV] which shouldn't be affecting the mouse visibility.

What's odd is that I have a file version where the mouse hide works (also has PauseController as part of the scene), so I'm really going nuts trying to remember what I could have changed that stopped it from working.

I checked the number of times I've used the "set mouse cursor" action, which is 2 (once for on and once for off), so there aren't any hiding in any other FSMs on accident.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set Cursor not working
« Reply #8 on: November 07, 2013, 02:06:56 AM »
Hi,

 Can you try on a clean project with just playmaker, does that work? then you can start  debugging your project to see what conflicting.

bye,

Jean

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: Set Cursor not working
« Reply #9 on: November 07, 2013, 01:48:23 PM »
It works in an empty scene, as well as previous file versions of my project. There's got to be something conflicting with it, I just have to find it  ::)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set Cursor not working
« Reply #10 on: November 08, 2013, 12:56:07 AM »
Hi,

 yeah... that's going to be tricky :)

 Make a copy of this project, and disable feature at a time until the problem stops.

-- also, are you using this action in several places?
-- Can you list all gameobject or component that set this cursor? you'll need to a make a global search in monodevelop to find out exactly and be effective.


Bye,

 Jean

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: Set Cursor not working [SOLVED]
« Reply #11 on: November 10, 2013, 09:05:32 PM »
Got it, finally.

I had one FSM controlling mouse show/hide on ESC press. I had a second FSM controlling menu show/hide on ESC press. The menu-controlling FSM had the "enable GUI" action on it. GUI was disabled on start, and then enabled when the user pressed ESC.

Apparently when the GUI is disabled, the "set mouse cursor" action will not work. Since Playmaker GUI auto-hides GUI elements that aren't specific to its current state, I didn't need the enable/disable GUI action anyways.

Yay! Thanks for the support everyone.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set Cursor not working [SOLVED]
« Reply #12 on: November 11, 2013, 12:34:50 AM »
Hi,

 Good findings! I am glad you found the issues, Debugging is key to steady progress, well done!

bye,

 Jean