Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Softme on September 24, 2022, 12:01:34 AM

Title: FSM still trigger start event and enter the first state after disable prefab.
Post by: Softme on September 24, 2022, 12:01:34 AM
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.
Title: Re: FSM still trigger start event and enter the first state after disable prefab.
Post by: djaydino on September 24, 2022, 02:00:56 AM
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.
Title: Re: FSM still trigger start event and enter the first state after disable prefab.
Post by: Softme on September 28, 2022, 06:49:26 AM
Thanks for replying. I use next frame event to solve this problem!