Hi everyone,
I’m having a persistent issue with my weather system logic that I can’t seem to figure out. The system is designed to cycle randomly between sunny weather and rain.
My setup is in a single Blueprint actor (BP_WeatherManager) which is replicated:
The Logic
-
Main Timer Logic (Server Only): I have a chain of timers (
Set Timer by Event) that run only on the server.-
On
BeginPlay, a timer (e.g., 10-15s) callsTrigger_StartRain. -
Trigger_StartRain(which checks ifIsRainingis false) calls theServer_StartRainevent. It then sets a new timer (e.g., 30-60s, the “Rain Duration”) to callTrigger_StopRain. -
Trigger_StopRain(which checks ifIsRainingis true) calls theServer_StopRainevent. It then sets a new timer (e.g., 50-70s, the “Sun Duration”) to callTrigger_StartRain. -
This creates a correct, non-looping chain.
-
-
Server Events:
-
Server_StartRaindoes only one thing: sets a replicated variableIsRaining = true. -
Server_StopRaindoes only one thing: sets the replicated variableIsRaining = false.
-
-
Client-Side Effect (The
OnRep_IsRainingfunction):-
When
IsRainingbecomesTRUE: It Plays a 10-second Timeline (WeatherTransition). This Timeline handles interpolating (Lerp) material parameters for the volumetric clouds (making them dark) and the directional light. -
When
IsRainingbecomesFALSE: It calls myStopRainfunction (to destroy particles) and plays the Timeline in Reverse (to clear the clouds).
-
-
Starting the Particles (The intended part):
- The
StartRainfunction (which spawns the Niagara particle “bubble” attached to the player) is called ONLY from theFinishedpin of theWeatherTransitionTimeline.
- The
The Problem
The first cycle works perfectly:
-
Sun (10-15s).
-
Server_StartRainis called. -
OnRepfires –> Timeline plays –> Clouds gather (10s). -
Timeline
Finished–>StartRainis called –>Rain particles begin. (Perfect!) -
Rain (30-60s).
-
Server_StopRainis called. -
OnRepfires –>StopRainis called (particles stop) –> Timeline reverses (clouds clear). (Perfect!)
Here is the bug:
After the StopRain timer (e.g., 50-70s) fires, the next cycle begins.
-
Server_StartRainis called. -
OnRepfires –> The Timeline starts playing (clouds start gathering). -
At the exact same time, the
StartRainfunction (particles) is also called, causing it to rain immediately while the sky is still sunny. -
Then, 10 seconds later (when the timeline finishes),
StartRainis called again (I can tell from the audio restarting).
Why is StartRain being called immediately on the second cycle, even though the Finished pin hasn’t fired yet? It seems like something is incorrectly “remembering” the Finished state from the previous run.
Any ideas would be greatly appreciated. Thanks!




