playMaker

Author Topic: Can I use a state boolean like this?  (Read 2163 times)

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Can I use a state boolean like this?
« on: October 27, 2012, 01:09:39 PM »
Sorry for the subject but I didn't know what to title this.

In the below screenshot I'm showing a single state in my FSM.  I was hoping this would actually work.  Here's what I'd like it to do:

Check if the PlayerPref exists, if yes, go to Finished
if no, continue on in the state
continuing on in the state sets the PlayerPrefs default data, and then Finishes as normal.



Will the state function as I expect?  Or is there a chance it will process the Set PlayerPrefs actions before Finishing?

Thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Can I use a state boolean like this?
« Reply #1 on: October 29, 2012, 01:30:16 AM »
Hi,

 and what's your findings? does it actually work? I would say yes.

 If you trigger an event that is within fsm, it will exit the state without processing following actions. Actions are processed in order starting from the top.

For clarity I would create a "KEY EXISTS" event and use that instead of "FINISHED". and have both transitions actually.

bye,

 Jean