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&)
1 Like
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
I had the same problem, so thanks you just saved my game. All you had to do was remove the post process layer from the camera and add it back on.
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.