playMaker

Author Topic: FSM still trigger start event and enter the first state after disable prefab.  (Read 163 times)

Softme

  • Playmaker Newbie
  • *
  • Posts: 9
I instantiate a prefab which has a fsm, and immediately disable it in the next line of code, but the fsm still trigger start event and enter the first state. But the current state of this fsm is supposed to be null.
So did I do something wrong? Or it's supposed to be enter the start state.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7086
    • jinxtergames
Hi.
Start state will triggger on start, what you can try is set a next frame event on the start state then on the next state do the trigger event.

will this prefab be instantiated a lot? (for example bunch of coins to pick up)
if so, you might want to do a different approach.

Softme

  • Playmaker Newbie
  • *
  • Posts: 9
Thanks for replying. I use next frame event to solve this problem!