Hello and thanks for the help/insight in advance!
I just upgraded to Unity 2022.1.1f1 and experienced the following Exception in UnityEngine.Rendering.DebugDisplaySettingsVolume. The issue is reproducible 100% within my project.
Thanks!!
Repo Steps:
- Load project
- Run game by pressing play button
- Stop game by pressing stop button
Observed the following exception upon the play mode stopping:
-
MissingReferenceException: The object of type ‘UniversalAdditionalCameraData’ 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.
-
In the Unity Scene View, objects no longer render as a result of the exception.
-
This exception now throws constantly in the Unity Editor and the Unity editor must be force-quit-and-restarted for the error to go away.
Notes:
It appears that there is a null entry in the additionalCameraDatas list of the VolumeDebugSettings class. This can be seen here:
Unity 2022.1 is unusable for me unit I can resolve this. My feeling is that this is a URP bug, thought it could be manifested by some unexpected configuration in my camera rig, or me accidentally clearing some sort of delegate by accident some where in my code. I did look over my stuff and it is pretty straight forward. I do make heavy use of multiple cameras and additive scenes.
My project is quite large 10Gigs so it may be hard to boil down a project that can reproduce this or upload a project file. Please advise if you feel this is a bug and how I should proceed, or if anyone has experienced/worked around this
Expected
Unity should not enter and inoperable state due.
Project Environment:
Unity 2022.1.1f1
Mac OSX 11.4
URP 13.1.8
Stack:
MissingReferenceException: The object of type 'UniversalAdditionalCameraData' 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 /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/Component.bindings.cs:42)
UnityEngine.Rendering.VolumeDebugSettings`1+<get_cameras>d__11[T].MoveNext () (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/VolumeDebugSettings.cs:64)
UnityEngine.Rendering.DebugDisplaySettingsVolume+WidgetFactory.CreateCameraSelector (UnityEngine.Rendering.DebugDisplaySettingsVolume data, System.Action`2[T1,T2] refresh) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsVolumes.cs:87)
UnityEngine.Rendering.DebugDisplaySettingsVolume+SettingsPanel..ctor (UnityEngine.Rendering.DebugDisplaySettingsVolume data) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsVolumes.cs:358)
UnityEngine.Rendering.DebugDisplaySettingsVolume.CreatePanel () (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsVolumes.cs:394)
UnityEngine.Rendering.DebugDisplaySettingsUI+<>c__DisplayClass3_0.<RegisterDebug>b__0 (UnityEngine.Rendering.IDebugDisplaySettingsData data) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsUI.cs:36)
UnityEngine.Rendering.DebugDisplaySettings`1[T].ForEach (System.Action`1[T] onExecute) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettings.cs:90)
UnityEngine.Rendering.DebugDisplaySettingsUI.RegisterDebug (UnityEngine.Rendering.IDebugDisplaySettings settings) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsUI.cs:47)
UnityEngine.Rendering.Universal.UniversalRenderPipeline..ctor (UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset asset) (at Library/PackageCache/com.unity.render-pipelines.universal@13.1.8/Runtime/UniversalRenderPipeline.cs:191)
UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset.CreatePipeline () (at Library/PackageCache/com.unity.render-pipelines.universal@13.1.8/Runtime/Data/UniversalRenderPipelineAsset.cs:384)
UnityEngine.Rendering.RenderPipelineAsset.InternalCreatePipeline () (at /Users/bokken/buildslave/unity/build/Runtime/Export/RenderPipeline/RenderPipelineAsset.cs:10)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

