[SOLVED] How to access Global Fog (Script) from code "C#"

How do I access the Global Fog Image Effect from code!?

I have search the internet but it does not seem to be known.

In my script I have added : using UnityStandardAssets.ImageEffects;

But no fog is available.

I know I can set fog to true with : RenderSettings.fog = true; but that is not what I want. I want only the image effect “Global Fog (Script)”.

I can do this manually in the editor at run time but cant do it with code it seems.

Anyone have any ideas?

For some reason Unity did not make the GlobalFog class public so just edit the GlobalFog.cs file and make the class public then all will be fine.

3 Likes

Thanks :slight_smile:

There doesnt seem to be a globalFog.cs anywhere, I cant find a way to access the fog shader anywhere

The above post is over 7 years old, please don’t necro old posts. If you have an issue, please create your own thread.

Thanks.