Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Alatriste on March 15, 2019, 01:32:46 PM

Title: Debug build error: The object of type 'PlayMakerFSM' has been destroyed[SOLVED]
Post by: Alatriste on March 15, 2019, 01:32:46 PM
Hi, I'm getting the following error when I build the game:

Quote
The object of type 'PlayMakerFSM' has been destroyed but you are still trying to access it.

I don't get the error during the normal walkthrough so I have no clue about what can be the issue. I kind of imagine maybe something related with prefabs but again, I'm running out of ideas about how to track what is causing the problem here.

Any ideas?
Title: Re: Debug build error: The object of type 'PlayMakerFSM' has been destroyed...
Post by: Alex Chouls on March 15, 2019, 04:18:46 PM
Are you getting this error when making the build?
Or when running the build?
Can you past the full error? It should have more info.
Title: Re: Debug build error: The object of type 'PlayMakerFSM' has been destroyed...
Post by: Alatriste on March 16, 2019, 04:00:11 AM
I'm getting this error while making the build. The build is done successfully though.

Code: [Select]
MissingReferenceException: The object of type 'PlayMakerFSM' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Component.GetComponent[T] () (at C:/buildslave/unity/build/Runtime/Export/Component.bindings.cs:42)
HutongGames.PlayMaker.FsmProcessor.AddUiEventHandler[T] (PlayMakerFSM fsm) (at Assets/PlayMaker/FsmProcessor.cs:63)
HutongGames.PlayMaker.FsmProcessor.HandleUiEvent[T] (PlayMakerFSM fsm, HutongGames.PlayMaker.UiEvents uiEvent) (at Assets/PlayMaker/FsmProcessor.cs:57)
HutongGames.PlayMaker.FsmProcessor.OnPreprocess (PlayMakerFSM fsm) (at Assets/PlayMaker/FsmProcessor.cs:38)
PlayMakerFSM.AddEventHandlerComponents () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:425)
PlayMakerFSM.Preprocess () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:225)
HutongGames.PlayMakerEditor.PlayMakerBuildCallbacks.OnPostprocessScene () (at Assets/PlayMaker/Editor/PlayMakerBuildCallbacks.cs:57)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
UnityEditor.Build.BuildPipelineInterfaces+AttributeCallbackWrapper.OnProcessScene (UnityEngine.SceneManagement.Scene scene, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:163)
UnityEditor.Build.BuildPipelineInterfaces+<OnSceneProcess>c__AnonStorey1.<>m__1 (UnityEditor.Build.IProcessSceneWithReport spp) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:387)
UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:356)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

I'm trying to figure out whether this is due to an FSM that is attached to an instanciated gameObject that is not controlled by Playmaker, but for another addon, which may destroy it before the FSM runs. But even disabling the FSM I still get the error, which is what confuses me and makes me think that this might not be the cause of the error.  :o

Running Unity 2018.3.0f2 & Playmaker 1.9.0
Title: Re: Debug build error: The object of type 'PlayMakerFSM' has been destroyed...
Post by: Alex Chouls on March 16, 2019, 08:22:53 PM
What's the full PlayMaker version info? e.g., 1.9.0.p13
Title: Re: Debug build error: The object of type 'PlayMakerFSM' has been destroyed...
Post by: Alatriste on March 17, 2019, 04:39:01 AM
Correct. I have 1.9.0 P13
Title: Re: Debug build error: The object of type 'PlayMakerFSM' has been destroyed...
Post by: adrian on April 01, 2019, 04:33:18 PM
Hi I am getting the same error and cannot build, any suggestions?
Running Unity 2018.3.9f1 and Playmaker 1.9.0.p13
Title: Re: Debug build error: The object of type 'PlayMakerFSM' has been destroyed...
Post by: Alex Chouls on April 01, 2019, 05:18:43 PM
There’s an update, 1.9.0.p14, that should fix this issue.
Title: Re: Debug build error: The object of type 'PlayMakerFSM' has been destroyed...
Post by: adrian on April 01, 2019, 06:15:23 PM
All sorted, thank you very much!
Title: Re: Debug build error: The object of type 'PlayMakerFSM' has been destroyed...
Post by: Alex Chouls on April 01, 2019, 10:21:45 PM
Thanks for letting us know :)
Title: Re: Debug build error: The object of type 'PlayMakerFSM' has been destroyed[SOLVED]
Post by: shamo on April 04, 2019, 04:25:59 AM
Hi, was having the same problem and could not build to Android with the same reported error. Updated to p14 and that seemed to fix it but now I'm getting crashes whenever trying to edit prefabs? The editor slows right down then brings up crash reporter  :-[ Totally unworkable now?
Title: Re: Debug build error: The object of type 'PlayMakerFSM' has been destroyed[SOLVED]
Post by: shamo on April 04, 2019, 04:40:25 AM
Hold that thought...ran 'update all FSM's in build' and it all seems good now. :P