gradually increase fog density to a random value

i am making making a day and night in my game and i want there to be gradually increasing fog when its night time and it to go away when its daytime.
is it possible?

1 Like

Hey there @SPOPTHEREAL! If you’re using the Exponential Height Fog class one of the key variables you’ll need to change is fog density.

image

Though the basics would be to first get a reference to your Exponential Height Fog, then you can set the variables you need to change directly. For my example I use a timeline and distinct events for the Day and Night transitions, depending on how gradual you want the change, you may want to use a linear interpolation tied to your day/night time instead of a timeline like my example here uses.

it just occurred to me that i didn’t post how my blueprints look like sorry about that



is it still possible to add in?

Absolutely, you can append this with a bit of splicing where your Add Actor World Rotation is.

Basically just normalizing the range for your rotation, then putting that through a linear interpolation for the range you want the Fog Density to be.

1 Like

thank you so much man

1 Like