playMaker

Author Topic: Wrong Event Sent Problem  (Read 2578 times)

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
Wrong Event Sent Problem
« on: February 25, 2016, 05:30:01 PM »
I have a weird situation where I have a state called 'PLAY_animation' which contains a Get Key Down action to have a Spacebar press send the event PAUSE but it is instead sending the event STOP.

What's really weird is that the Spacebar properly sends PAUSE early on when in this state but later (after visiting another state and then returning to this state) a Spacebar press will start sending STOP instead of PAUSE.

See the attached screengrab which shows STOP being sent (disregard the green incoming line to the state... it's looping back around).

Any ideas why this is happening?

Thanks!

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Wrong Event Sent Problem
« Reply #1 on: February 26, 2016, 09:15:22 AM »
Im a noob bit this does look weird so far lol. It may help, with the diagnosing, to know what should actually be sending the stop event.

I guess a screenshot of the actions in the state that causes it to stop sending pause (as you say early on it works) may help too.

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
Re: Wrong Event Sent Problem
« Reply #2 on: February 26, 2016, 11:34:23 AM »
Thanks for the ideas!

Basically, there are UI buttons to send events and a few keyboard presses to send some of the same events.  The UI buttons are sending events without problems.  Most of the Get Key Down actions send events without problems... but the keyboard press 'Space' is having problems.

I went through and changed all the Get Key Down actions to use 'P' instead of 'Space'.  When I did this, the proper events are sent flawlessly.

I then changed them all back to using 'Space' again and the problem reappears.

There is something wrong with using the 'Space' key.

Problem is... I need the user to use 'Space' as it is the intuitive choice for PLAYing and PAUSEing.

I'm wondering... is there a way to have the user press the 'Space' key but send the 'P' key instead?

(PS.  The STOP event is sent only by a UI button click... there is no keyboard press to send the STOP event).

Thanks again.
« Last Edit: February 26, 2016, 11:37:39 AM by mTruly »

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
Re: Wrong Event Sent Problem
« Reply #3 on: February 26, 2016, 12:01:44 PM »
OK... I got it sorted but it's still weird.

There was no Get Key Down action setup to send the STOP event... only PLAY and PAUSE. Weirdly, STOP was being sent when the spacebar was pressed.

So I setup a Get Key Down action to send STOP using the 'Return' key.  Now, when using the spacebar to send PLAY/PAUSE... STOP is no longer being sent.

Thanks!

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
Re: Wrong Event Sent Problem
« Reply #4 on: February 26, 2016, 12:19:35 PM »
Sigh... I spoke too soon.

Now pressing the 'Space' (setup to send PAUSE) is still sending the STOP event. Even when 'Return' is setup to send STOP.

So something is wacked with using the 'Space' key.

Thanks!

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Wrong Event Sent Problem
« Reply #5 on: February 26, 2016, 01:35:30 PM »
Lol weird...

But I had a simmilar issue when using easy touch asset (not sure if it will apply here, but maybe).

I had all touch buttons set up to respond to pressing space (by default). Had some very strange behaviour lol, when i actually pressed space- every button would be activated at once- but the actual touch buttons worked flawlessly (when used on screen and when space is not pressed).

I guess what im saying is that, maybe you should explore the entire 'ui stop button' in the inspector to ensure it is not being directly stimulated by the space key. (I attached an image of my jump button, that was messing around ((the bits that were causing the issue are highlighted in pink)), bear in mind mine is in easy touch, but your one may have something similar somewhere in the inspector for your GUI-button.)

I hope it helps (otherwise i can only guess that it may be a complex setting in inputs that is beyond my understanding)...
« Last Edit: February 26, 2016, 11:52:42 PM by Zeldag »

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
Re: Wrong Event Sent Problem
« Reply #6 on: February 27, 2016, 11:09:50 AM »
Thanks again for the ideas!

Definitely something weird about the 'Space' key.  I have double checked and the only setup to send the STOP event was on a Unity UI button.

Later, when I added the Get Key Down action (on 'Return') to send the STOP event... this seems to have stopped the problem with the 'Space' key for the most part.  I did have the problem reappear once (after adding the keyboard action for STOP) but it has not reappeared again so this seems to have helped.

Thanks again.