playMaker

Author Topic: Mouse Pick Event (Inifinite Loop) versus MOUSE DOWN system event[SOLVED]  (Read 1942 times)

dubealex

  • Playmaker Newbie
  • *
  • Posts: 2
Hi.

I'm trying to do a simple switch with a cube.

When I use the "Mouse Pick Event" to send an event on mouse down, it does a infinite loop. I though that the mouse down event would occur once. But it seems that when I return to the starting state (Which have the Mouse Pick Event action), the state finishes and execute my transition for Mouse Down again and again, infinite loop.

But, if I leave everything the same, but instead of using a Mouse Pick Event action, I use a system event transition of "MOUSE DOWN", and no action in the starting state, all is working exactly as intended. Why is that ?

I need Mouse Pick Event to check for raycast distance, so the button cannot be used from too far away.

I attached a pic of the FSM to this post.

Note: The FSM work like this in short: I take a bool from another FSM. I store it into a local bool into the switch FSM. I check against that local bool. True or False determine if I turn on or off the other FSM.

« Last Edit: February 04, 2014, 04:50:12 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Mouse Pick Event (Inifinite Loop) versus MOUSE DOWN system event
« Reply #1 on: February 03, 2014, 05:40:44 AM »
Hi,
 
 it really depends on each state actions and how they are setup.

 typically, when using "Mouse pick Event", I have one state only using the mouse down event entry, then it moves to another state JUST listening to the mouse up, else you do get infinite loop for sure.

bye,

 Jean

dubealex

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Mouse Pick Event (Inifinite Loop) versus MOUSE DOWN system event
« Reply #2 on: February 03, 2014, 10:35:17 PM »
Thank you, I just needed to add 1 state for a mouse up between the mouse down and the rest of the switch logic. Now it works.

Thanks.