I am working on a VR project in the urp, currently using unity 2020.2.6f1 (cannot upgrade to LTS yet due to dependancies).
My console is full of the warning
You can only call cameraDepthTarget inside the scope of a ScriptableRenderPass. Otherwise the pipeline camera target texture might have not been created or might have already been disposed.
UnityEngine.Rendering.Universal.ScriptableRenderer:get_cameraDepthTarget ()
HighlightPlus.HighlightPlusRenderPassFeature:AddRenderPasses (UnityEngine.Rendering.Universal.ScriptableRenderer,UnityEngine.Rendering.Universal.RenderingData&) (at Assets/Plugins/ART/HighlightPlus/Pipelines/URP/HighlightPlusRenderPassFeature.cs:73)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Does someone have any idea what can cause this and how to fix this?
Without looking at the code producing the error It’s going to be really hard to help you resolve the error.
I’ve seen the same error while working on my code, and it might be the same thing causing yours.
I resolved mine by passing the ScriptableRenderer class, when URP calls AddRenderPasses, to the ScriptableRenderPass class.
Truth be told, I feel like it’s a janky solution, but I haven’t been able to find someone from Unity giving us direction on what we should to do in this case, so