Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Post Process Stack NullRefferenceException

Discussion in 'Editor & General Support' started by theonciest, Mar 20, 2019.

  1. theonciest

    theonciest

    Joined:
    Jan 22, 2017
    Posts:
    12
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEngine.Rendering.PostProcessing.AmbientOcclusion.IsEnabledAndSupported (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Library/PackageCache/com.unity.postprocessing@2.1.3/PostProcessing/Runtime/Effects/AmbientOcclusion.cs:179)
    3. UnityEngine.Rendering.PostProcessing.PostProcessLayer.SetLegacyCameraFlags (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Library/PackageCache/com.unity.postprocessing@2.1.3/PostProcessing/Runtime/PostProcessLayer.cs:696)
    4. UnityEngine.Rendering.PostProcessing.PostProcessLayer.SetupContext (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Library/PackageCache/com.unity.postprocessing@2.1.3/PostProcessing/Runtime/PostProcessLayer.cs:781)
    5. UnityEngine.Rendering.PostProcessing.PostProcessLayer.BuildCommandBuffers () (at Library/PackageCache/com.unity.postprocessing@2.1.3/PostProcessing/Runtime/PostProcessLayer.cs:468)
    6. UnityEngine.Rendering.PostProcessing.PostProcessLayer.OnPreCull () (at Library/PackageCache/com.unity.postprocessing@2.1.3/PostProcessing/Runtime/PostProcessLayer.cs:402)
    7.  
    We keep getting this error pinging off over and over it goes between that and Suimono - Water System.

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Suimono.Core.SuimonoModule.LateUpdate () (at Assets/SUIMONO - WATER SYSTEM 2/SCRIPTS/SuimonoModule.cs:704)
    3.  
    We keep trying to import Post Processing but sometimes it works, and sometimes it just doesn't show up in the viewport. We keep fixing stuff, and then this breaks, we fix this, then more things break, and then this breaks. But this error keeps occuring. Not just Suimono

    Thanks
     
  2. theonciest

    theonciest

    Joined:
    Jan 22, 2017
    Posts:
    12
    Also when it does work, it won't push through source tree to make it work. Always have to reinstall the package via window - package manager - post processing 2.1.3

    2.1.4 doesn't work for some reason.
     
  3. theonciest

    theonciest

    Joined:
    Jan 22, 2017
    Posts:
    12
  4. theonciest

    theonciest

    Joined:
    Jan 22, 2017
    Posts:
    12
  5. BBQ_Abdi

    BBQ_Abdi

    Joined:
    Nov 9, 2013
    Posts:
    6
    I have the same problem.
     
  6. theonciest

    theonciest

    Joined:
    Jan 22, 2017
    Posts:
    12
    conspiracy I tell you lol
     
  7. Albarnie

    Albarnie

    Joined:
    Oct 24, 2015
    Posts:
    6
    Bump. I just got the same issue
     
  8. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    114
    Same here.
     
  9. YondernautsGames

    YondernautsGames

    Joined:
    Nov 24, 2014
    Posts:
    88
    Is this error immediately after importing the package, and then if entering play mode after importing the package?

    If it's the same bug that I was seeing then I submitted a bug report for this a while back that has now been reprod and is in the system (case 1171701).

    In my case it seemed to be that there is a hidden field in the PostProcessingLayer component on cameras, called "Resource" or something like that which is set when the object is imported or created. If the component shows as "missing script" because the package isn't installed, then installing the package doesn't correctly initialise that property and it spams errors to the console.

    The simplest way to resolve it is by restarting the editor after installing the post processing package. You can also try and ensure that any PostProcessingLayer components are disabled before the package is installed and then re-enabled after, though this might be a pain depending on your workflow. Hopefully it gets fixed soon.

    If this is a different error then apologies. Let me know and I'll remove this reply