playMaker

Author Topic: Loading a Template asset and then assigning it to a new PlayMakerFSM component  (Read 1347 times)

Deck

  • Playmaker Newbie
  • *
  • Posts: 3
Code: [Select]
public async UniTask Test() {
    var template = await Addressables.LoadAssetAsync<Fsm>("test.asset");
    var fsm = gameObject.AddComponent<PlayMakerFSM>(); // <-- crash
    fsm.SetFsmTemplate(template);
}

This will crash after adding the component, but I can't access the PlayMaker source code. How can I open the source code?

The workaround is to make a prefab with the FSM and template already installed, and then load that prefab... But it seems odd that PlayMaker crashes with something this simple.

Unity 2022.3.1f1. Latest PlayMaker version.
Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
PlayMakerFSM.Awake () (at C:/Projects/Playmaker_1.9.1/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:231)

(I don't have anything in that path)

I am less interested in this crash and more interested in being able to open the source code.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Hi.
I don't think that Playmaker is build to add templates at runtime.
When adding fsm's to prefabs they get 'registered' somehow for reference in editor mode, which probably gives the crash.

A big part of the source code is in a .dll file.
So its probably not intended to open the code :)

Deck

  • Playmaker Newbie
  • *
  • Posts: 3
How do devs debug PlayMaker issues like this? Are we entirely reliant on the authors?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Hi.
Most users of Playmaker do not know (or have little knowledge) how to code , so they would not encounter this kind of error :)