Pages (23)Time Module
- Overview
- Installation
- Getting started
- Quick Start window
- System overview
- Easy Weather Manager
- Time Module
- Celestial Module
- Cloud Module
- Volumetric clouds
- Cloud shadows
- Fog
- Detail Module
- Weather Effects Module
- Weather presets
- Events Module
- Lens flare occlusion
- Helper components
- Demo scene
- Scripting guide
- Troubleshooting
- FAQ
- Changelog
Time Module
Last updated 6 October 2026
The clock. It advances the time of day, counts days, rotates the sun and switches between the sun and moon lights. Every other module reads its time, so if you drive the time from your own game code, this is the only module you have to talk to.
Inspector
- Time Controls (always visible): Play and Pause, and the Dawn, Noon, Dusk and Midnight presets.
- Time Progression: the current time on a day gradient bar, Day Speed with the 1x, 60x, 300x and 1000x presets, and the day counter with Set Day, Reset and Skip +1, +7 and +30 days.
- Events: a timeline of the day, the day and night times, and the custom event times (+ Add Event).
- Setup: runtime start options and the sun and moon lights.
Play in Time Controls runs the clock in Edit Mode as well. Days can complete in Edit Mode this way, so if you subscribe to OnDayCompletedEvent from your own editor-time code, check Application.isPlaying. The weather system ignores edit-mode day changes.
Clock
| Setting | Default | Description |
|---|---|---|
enableTimeProgression | on | Master switch for the clock. Off, time stands still at currentTime |
currentTime | 12 | Current hour of the day, 0 to 24 |
daySpeed | 60 | Speed multiplier, 0 to 1000. 1 is real time, 60 makes one game hour last one real minute. A day lasts 86400 / daySpeed real seconds |
currentDay | 0 | Day counter |
enableTimeOnRuntime | on | Forces time progression on when Play Mode starts, even if the clock was paused in the editor |
useCustomStartTime, customStartTime | off, 8 | Time the scene starts at in Play Mode |
Day and night times
| Setting | Default | Description |
|---|---|---|
dayStartTime | 6 | Day begins. Also the center of the day and night ambience crossfade |
sunriseTime | 6 | When the sunrise event fires |
sunsetTime | 18 | When the sunset event fires |
nightStartTime | 20 | Night begins |
customEventTimes | Named times of day (name, time, enabled) that the Events Module reacts to |
These times decide IsDayTime(), IsNightTime() and when the events fire. They do not move the sun: the sun always crosses the horizon at 06:00 and 18:00.
Sun and moon lights
| Setting | Default | Description |
|---|---|---|
sunLight | The directional light that is rotated. In the prefab this is MainLight | |
autoUpdateSunRotation | on | Rotates the sun from the clock |
sunRotationOffset | 170 | Compass direction of the sun's path, in degrees |
autoToggleLightsByTime | on | Switches the sun light object on while the sun is above the threshold and off below it, every frame |
sunLightOnHeightThreshold | -0.05 | Sun height (the sine of its elevation, -0.4 to 0.4) where the lights switch. 0 is the horizon. Negative keeps the sun lit a little into twilight |
moonLight | Optional. A second directional light that is switched opposite to the sun: off by day, on at night |
The prefab has one directional light. If you want direct moonlight at night, add a second directional light and assign it as Moon Light.
Public API
| Member | Description |
|---|---|
void SetTime(float hours) | Jump to a time of day, 0 to 24 |
float GetCurrentTime() | Current hour, 0 to 24 |
float GetNormalizedTime() | Current time as 0 to 1 |
string GetFormattedTime() | Time as HH:MM:SS |
int GetCurrentDay(), int GetTotalDaysPassed() | Day counters |
void SetDay(int day), void ResetDayCounter() | Set or reset the day counter |
float GetSunHeight() | Sine of the sun's elevation: 1 overhead, 0 on the horizon, negative below it |
bool IsSunUp() | True while the sun height is above sunLightOnHeightThreshold |
bool IsDayTime(), bool IsNightTime() | Day is from dayStartTime to nightStartTime |
float GetTimeOfDayFactor() | A continuous 0 to 1 daylight factor from the sun height |
float GetDayStartTime(), GetSunriseTime(), GetSunsetTime(), GetNightStartTime() | The configured times |
float GetCustomEventTime(string name) | Time of an enabled custom event, or -1 |
bool IsCustomEventEnabled(string name) | Whether that custom event is enabled |
CustomEventTime[] GetAllCustomEventTimes() | All custom event times |
event Action OnDayCompletedEvent | Fires when the clock passes midnight. The weather scheduler listens to it |
Pages that link here
Still stuck?
Send us your Unity version, render pipeline and a screenshot of the problem.

