NullReferenceException in PolySpatialCore after updating to 0.2.2

Hi,

We’ve tried updating our project from PolySpatial 0.1.2 to 0.2.2 and we can no longer see anything, with the following error being spammed in the simulator:

[(73631.1) 13:25:41.131] [Error] [Diagnostics] EXCEPTION NullReferenceException in PolySpatialCore:
  at Unity.PolySpatial.Internals.PolySpatialUnitySimulation.UpdateBeforeChangeProcessing () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.PolySpatialUnitySimulation.Update () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.PolySpatialCore.PolySpatialAfterLateUpdate () [0x00000] in <00000000000000000000000000000000>:0 
NullReferenceException: Object reference not set to an instance of an object.
  at Unity.PolySpatial.Internals.PolySpatialUnitySimulation.UpdateBeforeChangeProcessing () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.PolySpatialUnitySimulation.Update () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.PolySpatialCore.PolySpatialAfterLateUpdate () [0x00000] in <00000000000000000000000000000000>:0 
UnityEngine.DebugLogHandler:LogException(Exception, Object)

In the editor, we see five exceptions (no spam):

[Diagnostics] EXCEPTION NullReferenceException in PolySpatialCore:
  at Unity.PolySpatial.Internals.PolySpatialUnitySimulation.UpdateBeforeChangeProcessing () [0x00310] in /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnitySimulation.cs:439 
  at Unity.PolySpatial.Internals.PolySpatialUnitySimulation.Update () [0x00063] in /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnitySimulation.cs:126 
  at Unity.PolySpatial.Internals.PolySpatialCore.PolySpatialAfterLateUpdate () [0x000b1] in /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/PolySpatialCore.cs:525 

NullReferenceException: Object reference not set to an instance of an object
Unity.PolySpatial.Internals.PolySpatialUnitySimulation.UpdateBeforeChangeProcessing () (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnitySimulation.cs:439)
Unity.PolySpatial.Internals.PolySpatialUnitySimulation.Update () (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnitySimulation.cs:126)
Unity.PolySpatial.Internals.PolySpatialCore.PolySpatialAfterLateUpdate () (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/PolySpatialCore.cs:525)
UnityEngine.Debug:LogException(Exception)
Unity.PolySpatial.Internals.PolySpatialCore:PolySpatialAfterLateUpdate() (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/PolySpatialCore.cs:532)

NullReferenceException: Object reference not set to an instance of an object
Unity.PolySpatial.Internals.PolySpatialUnitySimulation.UpdateBeforeChangeProcessing () (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnitySimulation.cs:439)
Unity.PolySpatial.Internals.PolySpatialUnitySimulation.Update () (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnitySimulation.cs:126)
Unity.PolySpatial.Internals.PolySpatialCore.PolySpatialAfterLateUpdate () (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/PolySpatialCore.cs:537)

NullReferenceException: Object reference not set to an instance of an object
Unity.PolySpatial.Internals.PolySpatialCore.OnSceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/PolySpatialCore.cs:566)
UnityEngine.SceneManagement.SceneManager.Internal_SceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode) (at /Users/bokken/build/output/unity/unity/Runtime/Export/SceneManager/SceneManager.cs:244)

NullReferenceException: Object reference not set to an instance of an object
Unity.PolySpatial.Internals.PolySpatialCore.OnSceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/PolySpatialCore.cs:566)
UnityEngine.SceneManagement.SceneManager.Internal_SceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode) (at /Users/bokken/build/output/unity/unity/Runtime/Export/SceneManager/SceneManager.cs:244)
UnityEngine.DebugLogHandler:LogException(Exception, Object)


This occurs even with a completely empty initial scene.

Our project is an existing game that we are investigating porting to visionOS, and we were able to see the game in 0.1.2. Could someone advise on a workaround to this issue?

Thanks!

In your project settings, under PolySpatial, do you by any chance have “Unity.PolySpatial.Internals.LightTracker” under “Disabled Trackers”? There is currently a bug where this causes a null reference exception. We will fix the issue in an upcoming release, but for now you will have to remove LightTracker from the disabled trackers list.

Thanks, this has resolved the issue :slight_smile:

2 Likes