playMaker

Author Topic: Wait for multiple iTween on other FSMs to complete before transition  (Read 1579 times)

tman1978

  • Playmaker Newbie
  • *
  • Posts: 11
I have a state where I broadcast a global event. This event causes multiple FSMs on other gameobjects to begin an iTween. The number of objects that do the iTween is variable. I would like my FSM that sent the global event to transition to a new state after ALL of the iTweens on the other FSMs are complete. How can I accomplish this?

vonpopov

  • Junior Playmaker
  • **
  • Posts: 98
I feel you should do this another way, because it looks very complicated.

Imo, you need to set up a global bool variable that your main FSM is waiting to be true in order to get to another state. (start value false)

All the other FSM selected :
- Should set that bool to false EACH frames during their iTween. ANd set it to True when iTween finished.

So, no matter a FSM set it to true, it would be reseted to false instantaneously by the other iTween sending False.

If not work, just put a double check to your Main FSM, with a wait. It should do the trick.

;)