How to Make a Day-Night Cycle in UE5 Blueprints
A day-night cycle is one rotating light wearing a system’s clothes: drive a time-of-day value, map it to the sun’s pitch, and let UE5’s sky do the heavy lifting. The design decision is day length and whether gameplay reads the clock.
What it’s made of
Variables
TimeOfDay float (0–24 is the readable convention), DayLengthMinutes float, and a reference to the Directional Light (sun) — plus UE5’s Sky Atmosphere and Sky Light reacting automatically.
Events
Event Tick advances the clock: TimeOfDay += (DeltaSeconds / (DayLengthMinutes × 60)) × 24, wrapped with a modulo at 24. A dispatcher like OnHourChanged lets gameplay (shops, spawns, streetlights) subscribe.
The logic
Map TimeOfDay to sun pitch: (TimeOfDay / 24) × 360 + 90, fed into Set Actor Rotation on the Directional Light — that phase puts the sun on the horizon at 6:00, overhead at 12:00, and below the world at midnight. With Sky Atmosphere connected to the light, dawn/dusk color comes free. Streetlights and emissives listen for hour thresholds instead of polling.
Key nodes you’ll wire
The mistake that breaks it
Rotating the light by a fixed amount per tick instead of deriving rotation FROM TimeOfDay — framerate changes the length of your day, and save/load can’t restore the clock.
New to how Blueprint systems fit together? Read the anatomy of a Blueprint system first.
Or skip the wiring — generate it
BlueprintStudio builds this system from a plain-language prompt — the right nodes, exec and data pins wired, defaults set, and the graph compiled to catch errors — then applies it into your open UE5 editor. The prompt is prefilled:
Build “Day-Night Cycle” in BlueprintStudioPrompt variations to try
Applying into your editor happens through the free Cosindra desktop app (Windows & macOS).