playMaker

Author Topic: FindFsmOnGameObject didn't work on Awake()  (Read 893 times)

nekolyst

  • Playmaker Newbie
  • *
  • Posts: 2
FindFsmOnGameObject didn't work on Awake()
« 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);
        }

    }
}

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: FindFsmOnGameObject didn't work on Awake()
« Reply #1 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 :)