playMaker

Author Topic: NullReferenceException in FsmVarOverride.Apply  (Read 910 times)

Eclipsed

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
NullReferenceException in FsmVarOverride.Apply
« on: June 12, 2018, 04:06:53 AM »
Hi,

I'm recently experiencing a NullReferenceException in FsmVarOverride.Apply, this happens in a RunFsm action which has lots of variable passed to it (16 parameters).

Here is a bit of the callstack of when the error occurs:
NullReferenceException: Object reference not set to an instance of an object
  at HutongGames.PlayMaker.FsmVarOverride.Apply (HutongGames.PlayMaker.FsmVariables variables) [0x00000] in C:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\CustomActionTypes\FsmVarOverride.cs:35
  at HutongGames.PlayMaker.FsmTemplateControl.ApplyOverrides (HutongGames.PlayMaker.Fsm overrideFsm) [0x0000e] in C:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\CustomActionTypes\FsmTemplateControl.cs:133
  at HutongGames.PlayMaker.FsmTemplateControl.InstantiateFsm () [0x00017] in C:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\CustomActionTypes\FsmTemplateControl.cs:73
  at HutongGames.PlayMaker.Fsm.CreateSubFsm (HutongGames.PlayMaker.FsmTemplateControl templateControl) [0x00000] in C:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\Fsm.cs:1437
  at HutongGames.PlayMaker.Actions.RunFSM.Awake () [0x0002f] in E:\UnityProjects\Elysium\Assets\3rdParty\PlayMaker\Actions\RunFSM.cs:33
  at HutongGames.PlayMaker.Fsm.Awake () [0x00026] in C:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\Fsm.cs:1627
  at HutongGames.PlayMaker.Fsm.Init (UnityEngine.MonoBehaviour component) [0x0001b] in C:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\Fsm.cs:1654
  at PlayMakerFSM.Init () [0x0003d] in C:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\PlayMakerFSM.cs:256
  at PlayMakerFSM.SetFsmTemplate (.FsmTemplate template) [0x0003c] in C:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\PlayMakerFSM.cs:486

Any idea of what's going on? Without access to the source code I'm blind.

Thanks.

Eclipsed

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: NullReferenceException in FsmVarOverride.Apply
« Reply #1 on: June 14, 2018, 01:51:45 AM »
So, I've narrowed down the problem.

Forgot to mention that we're using PlayMaker 1.8.9 on Unity 2018.1.0f2.

We have some fsm templates which expose some "inspector" variables, these templates are then used in Run FSM actions by other fsms.

One of the designers removed some of the inspector variables from some of the templates and now wherever they are used we're having this null reference exception.

Looking at the YAML for the assets I can see that the removed variables are still referenced in there, thus causing the error.

A fix to this is to just disable/enable the affected Run FSM actions, but we have more than 600 instances of those throughout the project!!

Any ideas?
Thanks!

Eclipsed

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: NullReferenceException in FsmVarOverride.Apply
« Reply #2 on: February 08, 2019, 02:51:50 AM »
Bumping this as we had this issue again.

Is there any solution in sight on your side?
Are you even aware of the problem?  ;D

Thanks.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3634
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: NullReferenceException in FsmVarOverride.Apply
« Reply #3 on: February 08, 2019, 09:13:00 AM »
Have you tried updating to 1.9.0? There was quite a lot of work done on the RunFSM action in 1.9.0.

Eclipsed

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: NullReferenceException in FsmVarOverride.Apply
« Reply #4 on: February 11, 2019, 10:06:05 AM »
Hi Alex,

yes, we're at 1.9.0.p5, still no luck with that.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3634
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: NullReferenceException in FsmVarOverride.Apply
« Reply #5 on: March 08, 2019, 07:14:33 PM »
Hi, sorry to leave this thread hanging for so long! Are you still having this issue with the latest update (1.9.0.p11)? If so, are you able to share the project?