- Home /
NullReferenceException PostProcessing AmbientOcclusion IsEnabledAndSupported
NullReferenceException: Object reference not set to an instance of an object UnityEngine.Rendering.PostProcessing.AmbientOcclusion.IsEnabledAndSupported (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Library/PackageCache/com.unity.postprocessing@2.3.0/PostProcessing/Runtime/Effects/AmbientOcclusion.cs:182) UnityEngine.Rendering.PostProcessing.PostProcessLayer.SetLegacyCameraFlags (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Library/PackageCache/com.unity.postprocessing@2.3.0/PostProcessing/Runtime/PostProcessLayer.cs:771) UnityEngine.Rendering.PostProcessing.PostProcessLayer.SetupContext (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Library/PackageCache/com.unity.postprocessing@2.3.0/PostProcessing/Runtime/PostProcessLayer.cs:863) UnityEngine.Rendering.PostProcessing.PostProcessLayer.BuildCommandBuffers () (at Library/PackageCache/com.unity.postprocessing@2.3.0/PostProcessing/Runtime/PostProcessLayer.cs:533) UnityEngine.Rendering.PostProcessing.PostProcessLayer.OnPreCull () (at Library/PackageCache/com.unity.postprocessing@2.3.0/PostProcessing/Runtime/PostProcessLayer.cs:462) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Can you please provide some code and/or screenshots? Also, some additional background information would be really helpful too.
The error is basically telling you that it is trying to access some object that doesn't exist because you haven't added it in the inspector, can't be accessed, or was destroyed/doesn't exist.
Answer by $$anonymous$$ · Feb 21, 2021 at 05:19 PM
hello there i had the same problem
try removing the post processing layer from the camera and then add it again it worked for me
Your answer
Follow this Question
Related Questions
HDRP ambient occlusion is not working with orthographic camera 0 Answers
im using post processing stack for the first time and then this happen, what should i do? thanks. 0 Answers
Ambient Occlusion not working with Orthographic camera 1 Answer
Scalable Ambient Obscurance and orthographic camera 0 Answers
Ambient occlusion stops at certain camera angles/positions 1 Answer