Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Qbanyto on December 02, 2021, 09:18:02 PM

Title: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on December 02, 2021, 09:18:02 PM
As the subject reads,
Whenever click on "edit" for whatever FSM i want to work on, i get this error. Screenshot attached. any ideas?  Please see pasted error log below.

----------------------------------------------

NullReferenceException: Object reference not set to an instance of an object
Lightbug.CharacterControllerPro.Core.CharacterActor.ToString () (at Assets/Character Controller Pro/Core/Scripts/Character/CharacterActor.cs:580)
HutongGames.PlayMaker.ActionHelpers.GetValueLabel (HutongGames.PlayMaker.INamedVariable variable) (at Assets/PlayMaker/Actions/ActionHelpers.cs:643)
HutongGames.PlayMaker.Actions.SetProperty.AutoName () (at Assets/PlayMaker/Actions/UnityObject/SetProperty.cs:45)
HutongGames.PlayMakerEditor.StateInspector.UpdateAutoSummarize (HutongGames.PlayMaker.FsmStateAction action) (at C:/Projects/Playmaker_1.9.1/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/Menus.cs:618)
HutongGames.PlayMakerEditor.StateInspector.UpdateAutoSummarize () (at C:/Projects/Playmaker_1.9.1/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/VariableManager.cs:128)
HutongGames.PlayMakerEditor.StateInspector.Reset () (at C:/Projects/Playmaker_1.9.1/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/VariableManager.cs:345)
HutongGames.PlayMakerEditor.StateInspector.OnGUI () (at C:/Projects/Playmaker_1.9.1/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/VariableTypeMenu.cs:237)
HutongGames.PlayMakerEditor.InspectorPanel.DoInspectorPanelGUI (UnityEngine.Rect area) (at C:/Projects/Playmaker_1.9.1/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/TimelineControl.cs:52)
HutongGames.PlayMakerEditor.InspectorPanel.OnGUI (UnityEngine.Rect area) (at C:/Projects/Playmaker_1.9.1/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/TimelineControl.cs:31)
HutongGames.PlayMakerEditor.FsmEditor.OnGUI () (at C:/Projects/Playmaker_1.9.1/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmEditorGUILayout.cs:1372)
HutongGames.PlayMakerEditor.FsmEditorWindow.DoGUI () (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:214)
HutongGames.PlayMakerEditor.BaseEditorWindow.OnGUI () (at C:/Projects/Playmaker_1.9.1/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/CustomAttributeHelpers.cs:182)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <ba030cc3475e41258f58c8c467eb72e2>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <ba030cc3475e41258f58c8c467eb72e2>:0)
UnityEditor.DockArea.OldOnGUI () (at <ba030cc3475e41258f58c8c467eb72e2>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <79197d32789c42609feb5591f73dd778>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <eb58cc8d9f124fc8b338f7a2aa050b46>:0)
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: djaydino on December 03, 2021, 07:32:50 AM
Hi.
It looks like some conflict with your 'CharacterControllerPro' and a Set Property Action.

A null reference means it can not find a object that supposed to be there.

More specifically on line 580 on the CharacterActor.cs script.

Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on December 03, 2021, 09:08:59 PM
Me and the asset dev have been trying to crack this. It started happening recently and I think it’s a Unity issue but it only happens when I click on the playmaker FSM component window
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: djaydino on December 04, 2021, 09:28:45 AM
Hi.
I will ping Alex.

What Playmaker / Unity version are you using?
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on December 04, 2021, 04:19:12 PM
I’m using the latest playmaker and latest unity.

Fwiw:
I DONT get the error if I open this FSM while in game mode.
But if I open it edit mode, it won’t load my fsm.

In other words I have to make changes during play mode, copy component while in play mode. Then exit play mode. Then in edit mode, I have to “paste component as new” to add all my
Changes. Delete the old fsm. Restart unity. And THEN i see the changes. But if I anytime I try to open the same fsm during edit mode, I get the bull reference error. And when I’m getting this errors, it throws off all the triggers to open doors. It disables my attack button.it just renders the project unusable 

A real pain since unity takes 4738 million years to load lol

Also this just started happening NOW.
I’ve been using  these assets for over a year now since I’ve started working on this project. 
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: djaydino on December 04, 2021, 05:53:47 PM
Hi.
Since you are in contact with the author, he might be interested making some dedicated actions so his asset supports Playmaker.
(which is faster that get/set properties actions as get/set properties actions use reflection)

Here is a link to the Playmaker API (https://hutonggames.fogbugz.com/default.asp?W127)
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on December 04, 2021, 06:09:18 PM
That’s the thing. I’ve been using playmaker and the character controller pro for about 11 months now. No issues. Now all the sudden I am getting these errors.
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: djaydino on December 05, 2021, 09:35:22 AM
Hi.
Oh, did you recently update unity and or playmaker?
or some assets?
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on December 05, 2021, 09:54:34 AM
Yes I did. Could that be the issue ? Triggerss are not being detected on some items either. Timers (wait) don’t work either (as posted on another thread ) and get/set property isn’t working for me. Man, I should of never updated but I had a unity crashing bug that only got  fixed when I updated unity.
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: djaydino on December 05, 2021, 09:58:41 AM
Hi.
Can you see which version you updated to?
did you update both or only unity?

Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: djaydino on December 05, 2021, 10:00:19 AM
Hi
are you on discord?
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on December 05, 2021, 11:06:12 AM
Yes with the same screen name too
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Alex Chouls on December 08, 2021, 01:20:46 PM
It looks like Lightbug.CharacterControllerPro.Core.CharacterActor.ToString() needs to guard against a null reference exception. Has the author taken a look at that method?

PlayMaker calls ToString() when auto-summarizing an action when collapsed. So a possible workaround (for now) would be to try turning off Auto Summarize Folded Actions in PlayMaker Editor > Preferences > Experimental
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on December 08, 2021, 04:24:55 PM
We were able to "comment out" the toString sections and that fixed the Null message from being displayed but the actual bug still remains.

whenever i open the fsm that contains the main controls to my character using this third-party asset in conjunction with playmaker, then the triggers stop working. the input manager won't work. etc. it breaks all the logic for some reason. ONLY happens if i open that fsm. that specific one. and this didn't happen before. I've been working on this game for about a year now and all the sudden i have this issue.
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Alex Chouls on December 13, 2021, 01:11:15 PM
Can you share your project so I can take a look? If so please PM me a link.
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on December 13, 2021, 01:34:43 PM
I can’t share my project because one is copyright and I don’t have permission and two is 15 GB so far. Are there any known issues with the latest unity and play maker with Triggerss? My triggers stop working as well.

I exported my project as a package and tried to import it into 2019 unity along with 2020 unity but I’m getting a plethora of issues like that. Also my geometry for one of my characters are discombobulated.
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Alex Chouls on December 15, 2021, 10:50:57 AM
Hi, I sent you a PM about joining the PlayMaker Beta group, not sure if you saw it?
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on December 15, 2021, 12:01:18 PM
Yes I responded. I’m waiting for the link :)
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on December 19, 2021, 09:00:29 PM
any updates on this? i cannot see any changes with ANYTHING related to playmaker unless i restart unity.  even if its something as simple as a Audio Play, or changing a bool, etc. the changes wont take effect unless i restart unity.
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Alex Chouls on December 19, 2021, 09:13:54 PM
For triggers:

Trigger and other MonoBehaviour events are handled by optional components automatically added by PlayMaker when those events are used in an FSM. These events can effect performance, so we only want to handle them if they're used.

You can find the list of event components in Components > PlayMaker > Event Handlers.

Normally event components are hidden in the editor, to avoid cluttering the UI. You can select PlayMaker Preferences > Debugging > Show PlayMaker Event Handler Components, then when you hit play you should see the event components added to the GameObject and you can check their setup.

Sometimes event components can get saved with a GameObject. You can delete these components and they will get re-added as needed.

Do you see trigger event components added when you select this debug option?

-----
Was typing above when you posted. It sounds like you're having more systemic issues. I'm not sure I understand what's happening. Can you post a quick video of what "not seeing any changes" looks like? And any errors in the console.

Have you tried updating PlayMaker after you updated Unity?
What version of Unity did you update from?
Different versions of Unity can require a PlayMaker update. Try re-downloading it in the Package Manager to get the right version.
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on January 02, 2022, 01:11:26 PM
Yes whenever I make a change to the main fsm that controls my main characters logic, I have to restart unity in order to see its effects. Other wise it just stops working.  Usually it triggers that bull reference error.

I can try to do a video.
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on January 12, 2022, 08:49:07 PM
Been busy with work and family and holidays so I haven’t had a chance to make a video.

But I will say the issue has gotten worse. Before, it was only with one character.
Now when I open ANY fsm using playmaker editor while in edit mode, the engine bugs out and nothing works. I have to restart unity. Even with something as simple as a water ripple that uses playmaker fsm.

If I open the playmaker fsm editor during GAME mode,  everything works fine. But I MUST close out the playmaker window or change to the fsm of another object, if i want to make sure the fsm im working on still works.

It’s hard to explain.

Basically, I can ONLY edit/test/create/use playmaker while in game mode. Otherwise if i try to edit the fan while in edit mode, like we’re supposed to, it breaks all the logic on which never gameObject I’m viewing the fsm for.

If I have a ball that uses playmaker fsm to bounce, and I open the fsm while in edit mode, and then hit play, it doesn’t bounce. But if I restart unity, and NOT open the fsm, and hit play, the ball bounces.

My current work around is:
If I make changes In game mode, I then have to copy component, stop game mode,. Paste component as new,  erase old component. Restart unity. And then it works (as long as I don’t open that playmaker fsm)

In conclusion, playmaker is breaking playmaker for some reason.

I got a link for the beta. I haven’t tried it yet. I will soon because this is crazy.

EDIT:  now playmaker breaks playmaker when open in giant playmaker fsm regardless if I’m in edit mode or play mode. Can someone look into this? You u have the same issue? I have to restart unity , literally every time I make a change with a playmaker fsm in order to see the changes.

On unity 2021.2.5f1
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on May 04, 2022, 06:59:50 PM
any updates on this? couple of months later and still dealing with this.

Basically, any changes i make with ANY Playmaker fsm, i have to restart unity to make it work. other wise it doesnt.
Title: Re: NullReference Error EVERYTIME I open the Playmaker FSM
Post by: Qbanyto on May 12, 2022, 10:21:11 PM
I guess this is a bug with no fix. I'll keep dissecting..