playMaker

Author Topic: Custom Action with OnFixedUpdate - How to send event from within? [SOLVED]  (Read 2135 times)

ScriptGeek

  • Playmaker Newbie
  • *
  • Posts: 3
I have 2 FSMs setup and one of them has global events configured and the other has a custom action that uses OnFixedUpdate and within this OnFixedUpdate method it calls Fsm.Event() to send an event to the other FSM with the global events; however, the events are never sent.  The custom action needs to run every physics step.

I've used debug statements to troubleshoot and nothing happens when the call to Fsm.Event happens.  Any ideas on why this could be?  Is there any example code I can look at that successfully sends events from OnFixedUpdate?
« Last Edit: January 12, 2015, 03:05:02 AM by ScriptGeek »

ScriptGeek

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Custom Action with OnFixedUpdate - How to send event from within?
« Reply #1 on: January 02, 2015, 05:15:23 PM »
Ok, so I read "How to create a global event", http://hutonggames.com/playmakerforum/index.php?topic=1762.0, since I think that might be my problem.  My custom script doesn't send events every frame, only when it needs to send one, which should be very reasonable with not even once per second on average.  I'll keep searching for a solution.


ScriptGeek

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Custom Action with OnFixedUpdate - How to send event from within?
« Reply #2 on: January 02, 2015, 09:43:16 PM »
I figured it out.  I have my global events setup incorrectly, they were attached to the wrong state, a state which did nothing... which didn't help me solve the problem, but was a great troubleshooting experience.