Jump to content

NullReferenceException in TerrainScene.cs:654 and AudioFilterGUI.cs:42


Thomas123

Recommended Posts

Another question about an error in Gaia. It does not seem to have any (visible) impact for now and is gone after the terrain is loaded. But what is this error about and how do I solve it? Can someone point me to the right direction please?

Bildschirmfoto-2023-06-16-um-09-17-45.pn

 

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.AudioFilterGUI.DrawAudioFilterGUI (UnityEngine.MonoBehaviour behaviour) (at /Users/bokken/build/output/unity/unity/Editor/Mono/Inspector/AudioFilterGUI.cs:42)
UnityEditor.Editor.DoDrawDefaultInspector () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Inspector/Editor.cs:865)
UnityEditor.Editor.DrawDefaultInspector () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Inspector/Editor.cs:826)
UnityEditor.Editor.OnInspectorGUI () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Inspector/Editor.cs:882)
ShadowBox.Attributes.Internal.ButtonMethodMonoBehaviourEditor.OnInspectorGUI () (at Assets/Shadowed/ShadowBox/Attributes/ButtonMethodAttribute.cs:43)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0 () (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:713)
UnityEditor.InspectorWindow:RedrawFromNative() (at /Users/bokken/build/output/unity/unity/Editor/Mono/Inspector/InspectorWindow.cs:195)
NullReferenceException: Object reference not set to an instance of an object
Gaia.TerrainScene.UnloadScene (UnityEngine.SceneManagement.Scene scene, System.Boolean& loadRequested, System.Boolean& unLoadRequested, Gaia.LoadState& loadState, System.Boolean isImpostor, System.Boolean bypassTreshold) (at Assets/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/TerrainScene.cs:654)
Gaia.TerrainScene.UpdateLoadState (System.Collections.Generic.List`1[T] referenceList, Gaia.LoadState& loadState, System.Boolean& loadRequested, System.Boolean& unLoadRequested, System.Boolean isImpostor) (at Assets/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/TerrainScene.cs:234)
Gaia.TerrainScene.RemoveAllReferences (System.Boolean forceSceneRemove) (at Assets/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/TerrainScene.cs:107)
Gaia.TerrainLoaderManager.UnloadAll (System.Boolean forceUnload) (at Assets/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/TerrainLoaderManager.cs:1277)
Gaia.TerrainLoaderManager.OnApplicationQuit () (at Assets/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/TerrainLoaderManager.cs:639)

 

Link to comment
Share on other sites

Hi @Thomas123,
the null reference error is a generic error message that means "an object reference does not exist when it should". Imagine a script working with a water material. If you would delete the water material while the script is running this will result in a null reference error the next time the script is trying to access that water material, because "it is not there" anymore.
In your case those are two separate errors, one seems to be inside unity's audio filter component, I cannot comment on that one much as it is not part of our products.

The other one is thrown inside of Gaia, and it is a bit weird:

image.png

The error is thrown in line 654 of TerrainScene.cs, the only thing that can be null here is the m_asyncLoadOp, and that is being created the line before. My best guess is that a scene is being unloaded, and for some reason the asynchronous operation for that cannot be created.
You could try to put a Debug.Log statement down before like so:


image.png

This would print out the scene name to the console before the unload happens, maybe this gives some insight what is going on (e.g. does this happen for all scenes, or a single scene only)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...