Please or Register to create posts and topics.

AtmosphericScattering NullReferenceException

Hi,

I have built a scene that works all fine, but when I start the game, I get "NullReferenceException: Object reference not set to an instance of an object" somewhere in AtmosphericScattering. I can fix it by disabling the script AtmosphericScattering in Scene Settings, but I would like to know what I am missing here.

Thanks

Marian

 

Hi Marian, please copy/paste the whole error log from Unity console so that we can track it down. Sometimes effect's references are lost during Unity import so reimporting the Atmospheric Scattering folder under Graphics directory may help.

Hi,

thanks for the fast reply. It may be related to my switch to universal render pipeline because I needed special effects on some of my game objects. I saw later, that TerraUnity does not support VFX with scripted render pipelines. Sorry, I'm pretty new to Unity programming, so maybe Atmospheric Scattering means to be turned off intentionally.

Anyway, maybe it helps. Here is the full error message from the Logs:

NullReferenceException: Object reference not set to an instance of an object
TerraUnity.Runtime.AtmosphericScattering.OnWillRenderObject () (at Assets/TerraWorld/Graphics/Pro/Effects/Atmospheric Scattering/Code/AtmosphericScattering.cs:329)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

 

Did you have a chance on getting further on the issue? For HDRP, URP or any other SRP templates, please use own Unity solutions for effects like atmospheric fog, volumetric lighting and...