playMaker

Author Topic: MOUSE DOWN events not working properly after Unity Update to 4.1.2f1  (Read 11023 times)

Evalar

  • Playmaker Newbie
  • *
  • Posts: 3
So woke up this morning to do some last minute tweaking before we demo our game off tomorrow and somehow in a haze I decided it would be a grand idea to update unity/playmaker/ngui, doh. Then before testing to make sure everything worked I tweaked a few cosmetics on the game, doh again. Then I built and ran it and now for some strange reason none of my System Event - MOUSE DOWN events fire off my NGUI buttons. Previously all this worked, unity must still be seeing the MOUSE DOWN events because the other OnClick triggered actions, like offset/scale, fire.

Tried switching them to Mouse Pick and they don't work correctly, will probably need additional tweaking with that. If there isn't an easy fix to this I guess I can do that but I'm guessing this is something simple I am missing.

Any ideas would be greatly appreciated on how to fix this or what could have caused this.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: MOUSE DOWN events not working properly after Unity Update to 4.1.2f1
« Reply #1 on: April 18, 2013, 01:59:49 AM »
Hi,

 indeed, we had the same problems stick with 4.0 for now, We could not update ngui to the latest unity version, I am not too sure why tbh

Does the ngui samples work fine in that project?

bye,

 Jean

Evalar

  • Playmaker Newbie
  • *
  • Posts: 3
Re: MOUSE DOWN events not working properly after Unity Update to 4.1.2f1
« Reply #2 on: April 18, 2013, 09:12:04 AM »
I have found no other issues with NGUI since the update. Everything else I have done with the plugin works just fine.

Evalar

  • Playmaker Newbie
  • *
  • Posts: 3
Re: MOUSE DOWN events not working properly after Unity Update to 4.1.2f1
« Reply #3 on: April 18, 2013, 11:28:35 AM »
Tried a few different things before giving in and reverting back to 4.0.1. Works well again. Not sure if this qualifies for a solved or not ha.

ghostmachine

  • Playmaker Newbie
  • *
  • Posts: 8
Hey Jean,

Any news on a fix for 4.1.3 yet involving mouse down events? I am working on a workaround for NGUI and Playmaker involving button states. If you have any new suggestions please advise. The scenario is with a GUI button press from the left mouse button in a system event delivering a window opening through event action.
thanks

I attached the event script to the button, but when I press the mouse button on the NGUI button the FSM is not initiated. It just sits on click but if I hit the event in the inspector the FSM works great.... ;(
« Last Edit: May 27, 2013, 12:40:15 PM by ghostmachine »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
hi,

 What is FSB? sorry :)

 Are you sure that nGUI does get events in the first place? for example use a ngui UIButtonTween or something? if your button can trigger tweens, then we can look further.

It could be that the collider of the button is not getting events because something else is covering it. double check that, that's often something overlooked.

bye,

 Jean

ghostmachine

  • Playmaker Newbie
  • *
  • Posts: 8
Sorry Jean

I meant FSM
In Short I have a Player with a FSM,which reads the get key and brings up the backgrounds and one button. I have a second button on the bottom, which is suppose to bring up the background and second button. The getkey works great it is the mouse read state. I attached the script provided to the player and button . the script was the NGUI events to Playmaker Fsm Event. When the scene is initiated the button goes through intween from NGUI and fires two events to the console. The first is OnPress and OnHover events. I tried to access them with a system transition to no avail. Maybe I am doing something wrong or stupid. This is so frustrating a simple communication from the mouse to the event. Any suggestions pleas here is attachments.
« Last Edit: May 27, 2013, 08:20:47 PM by ghostmachine »

ghostmachine

  • Playmaker Newbie
  • *
  • Posts: 8
Update to Mouse Down event..
Downloaded newest version of NGui Events to Playmaker Fsm events.
Changed Intbuttons system event to NGUI/ on hover and the Fsm_clicked worked.. but only on hover. Changed it back to NGUI / ONCLICK and NGUI/ONPRESS and no luck ;(  I have watched both states in the console window after pressing button bool true bool false. What is next??

ghostmachine

  • Playmaker Newbie
  • *
  • Posts: 8
I believe I have a workaround with the NGUI states.
the NGUI events from the NGUI to Playmaker register two states up and down. So what I did was place On push on all states and then added a Idle to wait in between. This made everything work, probably not the most efficient.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

-- are you using the latest version of ngui and the latest version of PlayMaker support from the wiki?

-- NGUI / ON PRESS has a boolean flag for up and down state in it's event data ( use get event info to retrieve that boolean)

-- same with NGUI / ON HOVER

-- new global events are present like NGUI / ON PRESS DOWN and NGUI ON PRESS / UP that is even easier in your case I would say.

 Bye,

 Jean