Kaira Digital ArtsKaira Digital Arts
Pages (23)Weather Effects Module

Weather Effects Module

Last updated 6 October 2026

Runs the weather. A weather is a weather preset asset. This module picks one, spawns its prefabs, blends its values in and out, plays its sounds and fires its events.

Weather only runs in Play Mode. In Edit Mode the module does nothing, and the inspector's start and stop buttons refuse to run.

Settings

SettingDefaultDescription
availableEffectsThe pool of presets. + Create New Effect and + Add Existing Effect manage the list. The prefab ships with the three demo presets
currentWeatherThe running preset, or empty
enableAutomaticWeatheroff (on in the prefab)Picks the weather automatically every day
scheduledWeatherThe preset the automatic system runs next. Set by the daily roll, or by hand
clearWeatherChance0.5Probability, 0 to 1, that a day stays clear
skipFirstDayonThe first day after the game starts is always clear
transitionDuration2Fallback blend time in seconds. Presets use their own transition times

Automatic weather

With enableAutomaticWeather on, the module works at every day change (when the clock passes midnight):

  1. Any running weather stops. Weather never carries over into the next day.
  2. The day's weather is rolled: first against clearWeatherChance, then weighted by each preset's probability.
  3. A start time inside the preset's start window (preferring day or night if the preset asks for it) and a duration between its minimum and maximum are picked, in game hours.
  4. When the clock reaches the start time, the weather starts. When its duration has passed, it stops.

Select Next Weather Now in the inspector runs the roll by hand.

Manual weather

StartWeather, StartWeatherByName and Start Random Weather start a preset immediately. Weather started this way does not stop by itself after a duration: call StopWeather().

Starting a weather while another one runs stops the first one and blends straight into the new one.

How an override lives

  1. Transition in. The preset's values blend in over its Transition In time. Only the values the preset ticks are touched.
  2. Hold. While the weather runs, the sky colors, the sun light and the ambient light belong to the preset: the Celestial gradients and curves step aside, so the clock cannot write the clear sky back. Cloud and night sky values that a 24 hour curve drives are rewritten every frame. Values without a curve are left where the transition put them, so you can still change them at runtime.
  3. Transition out. When the weather ends, everything fades over Transition Out to what the time of day says at that moment, not to the value from when the weather began. A six hour storm therefore ends without a jump.

Post processing

A preset can blend a URP Volume profile in. The module keeps two hidden global volumes and cross-fades them, so switching straight from one weather to another never pops. The profile is applied on top of the scene's own volumes.

Weather audio

Each preset can play a weather loop, a wind loop, an ambient loop and repeating thunder, on the manager's four weather audio sources. Fades in and out are set per preset. See Weather presets.

Clear weather ambience

Ambience that plays while no weather is running, on three separate sources so it never cuts off the weather audio.

SettingDefaultDescription
enableClearAmbienceoff (on in the prefab)Switches the ambience on
clearAmbienceDayClip, clearAmbienceDayVolume0.4Day layer
clearAmbienceNightClip, clearAmbienceNightVolume0.4Night layer
clearAmbienceWindClip, clearAmbienceWindVolume0.3Wind layer, plays day and night
clearAmbienceDayNightBlendHours1Width of the day and night crossfade in game hours, centered on the Time Module's day start and night start
clearAmbienceFadeDuration3Fade time in seconds when weather starts or ends

If only one of the day and night clips is set, it plays around the clock. Each preset decides how loud the ambience stays while it runs (clearAmbienceVolume, 0 by default, which silences it).

Public API

MemberDescription
void StartWeather(WeatherEffectData data)Start a weather immediately
void StartWeatherByName(string effectName)Same, by the preset's Effect Name
void StopWeather()Stop the running weather and blend its values out. currentWeather becomes null
void SelectNextWeather()Run the daily roll now
void ScheduleWeather(WeatherEffectData data)Set the preset the automatic system runs next. Null means a clear day
void ScheduleWeatherByName(string effectName)Same, by name
void ForceStartScheduledWeather()Start the scheduled preset now
WeatherEffectData GetScheduledWeather()The scheduled preset
float GetScheduledStartTime(), float GetScheduledDuration()Start time and duration picked for today's weather, in game hours. The start time is -1 when nothing is scheduled
bool IsWeatherActive(), bool IsWaitingToStart()Current state
string GetCurrentWeatherName()Name of the running weather
float GetWeatherElapsedHours(), float GetWeatherRemainingHours()Progress of the running weather in game hours
float GetClearAmbienceLevel()Current clear ambience level
void TriggerCustomEventByName(string eventName)Fire one of the running preset's custom events by hand

StopWeather() sets currentWeather to null. If your script calls anything that can stop the weather and then keeps using currentWeather in the same frame, check it for null first.

Pages that link here

Still stuck?

Send us your Unity version, render pipeline and a screenshot of the problem.

Contact support