question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Null reference exceptions in play mode when Experimental Play Mode options are enabled.

See original GitHub issue

Seems like the gesture manager only works once successfully. After leaving playmode once and going back in I’m spammed with null reference exceptions.

MissingReferenceException: The object of type 'AnimationClip' 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.Object.get_name () (at <7d87237cea3743d093e22c5b98f74fba>:0)
GestureManager.Scripts.Editor.GestureManagerEditor.OnCheckBoxGuiHandAnimation (GestureManager.Scripts.Extra.ModuleBase module, System.Int32 i, System.Int32 position, System.Boolean overrider, System.Boolean& isOn) (at Assets/GestureManager/Scripts/Editor/GestureManagerEditor.cs:213)
GestureManager.Scripts.Editor.GestureManagerEditor.OnCheckBoxGuiHand (GestureManager.Scripts.Extra.ModuleBase module, GestureManager.Scripts.Extra.GestureHand hand, System.Int32 position, System.Boolean overrider) (at Assets/GestureManager/Scripts/Editor/GestureManagerEditor.cs:207)
GestureManager.Scripts.Editor.Modules.Vrc3.ModuleVrc3.EditorContentGesture (UnityEngine.UIElements.VisualElement element, GestureManager.Scripts.Editor.Modules.Vrc3.Vrc3WeightController weightController) (at Assets/GestureManager/Scripts/Editor/Modules/Vrc3/ModuleVrc3.cs:276)
GestureManager.Scripts.Editor.Modules.Vrc3.ModuleVrc3+<>c__DisplayClass44_0.<EditorContent>b__0 () (at Assets/GestureManager/Scripts/Editor/Modules/Vrc3/ModuleVrc3.cs:210)
GestureManager.Scripts.Core.Editor.GmgLayoutHelper.MyToolbar (System.Int32& toolbar, UnityEngine.GUIContent[] contents, System.ValueTuple`2[System.String,System.Action][] actions) (at Assets/GestureManager/Scripts/Core/Editor/GmgLayoutHelper.cs:40)
GestureManager.Scripts.Core.Editor.GmgLayoutHelper.MyToolbar (GestureManager.Scripts.Core.Editor.GmgLayoutHelper+Toolbar& toolbar, System.ValueTuple`2[System.String,System.Action][] field) (at Assets/GestureManager/Scripts/Core/Editor/GmgLayoutHelper.cs:35)
GestureManager.Scripts.Editor.Modules.Vrc3.ModuleVrc3.EditorContent (System.Object editor, UnityEngine.UIElements.VisualElement element) (at Assets/GestureManager/Scripts/Editor/Modules/Vrc3/ModuleVrc3.cs:208)
GestureManager.Scripts.Editor.GestureManagerEditor.ManagerGui () (at Assets/GestureManager/Scripts/Editor/GestureManagerEditor.cs:95)
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 <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Boolean straightY, System.Single pixelsPerPoint, System.Exception& immediateException) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.UIElements.PanelClearFlags clearFlags) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)

Looking into it, it seems that the ModuleVrc3Styles.Data.GestureClips array is full of null AnimationClips and the code is trying to grab the name of them.

Nothing unusual about my setup, I’d think. I only have 1 scene loaded with one avatar. Just looks like unity is destroying the animation clips.

Using VRCSDK3-AVATAR-2022.06.03.00.04 and Unity 2019.4.31f.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rurrecommented, Jul 30, 2022

Hey, thanks for the resposne. I didn’t realize I forgot to resepond to this.

I did the changes locally and everything works well! Thank you!

0reactions
rurrecommented, Aug 5, 2022

Great!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug - Enter play mode settings (Experimental) not working
Hi When using Enter play mode settings in Project Settings I get errors from the localization package. [ATTACH] MissingReferenceException: ...
Read more >
Null Reference Exceptions
Null Reference Exceptions. A NullReferenceException happens when you try to access a reference variable that isn't referencing any object.
Read more >
Unity throws a NullReferenceException error only when " ...
Again, for clarification, Unity only throws the Null Reference Error if the game is run in Maximize On Play through the editor.
Read more >
Unity - How to stop Play Mode in case of infinite loop?
Break the loop with a null value and some other options · Attach the debugger. · Add a breakpoint at a line that...
Read more >
Patch Notes | Odin Inspector for Unity
Fixed GUIClip push/pop error when entering play mode. ... Fixed rare case where a null reference exception would be thrown when a validation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found