Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: nekolyst on November 04, 2022, 10:54:11 PM

Title: FindFsmOnGameObject didn't work on Awake()
Post by: nekolyst on November 04, 2022, 10:54:11 PM
FindFsmOnGameObject was return null on Awake().

Example code:

Code: [Select]
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
public abstract class SampleAction: FsmStateAction
{
        PlayMakerFSM fsm;

        public override void Awake()
        {
            Debug.Log(Owner);
            Debug.Log(Fsm.Name);

            fsm = PlayMakerFSM.FindFsmOnGameObject(Owner, Fsm.Name);

            Debug.Log(fsm);
        }

    }
}
Title: Re: FindFsmOnGameObject didn't work on Awake()
Post by: djaydino on November 05, 2022, 12:36:50 AM
Hi.
Playmaker fsms should not use Awake.
Have a look to other action scripts to get familiar with them :)