06 / 20
Packages/2D Parallax Pro/Day & night clock
LIGHT & ATMOSPHERE
06 / 20

Day & night clock

Clock timing, daylight curves, pause ownership and events.

English guideSource: Unity 6000.3.13f1 · URP 17.x optional10 October 2026

The clock owns time progression and daylight evaluation. Layer colors, lighting and celestial artwork respond through their own configured components.

Clock settings#

The supplied UI has its own authored values. The 120-second cycle below is a guide exercise, not a required screenshot value.

FieldBehavior
HourZero midnight, six morning, twelve noon, eighteen evening; 24 wraps to zero.
Automatic / PausedEnable progression / hold the current hour.
Full Day Duration / Time ScaleAt 120 seconds and scale one, a cycle takes 120 seconds; scale two gives 60 seconds.
Sunrise / Sunset / TwilightGuide example: 6 / 18 / 1 clock hour. Daylight fades around the boundaries.
Daylight SmoothingHigher values respond faster; zero applies immediately. Try five for visual fading.
TEXT
clockHours / second = 24 / fullDayDuration * timeScale

Automatic progression runs in Update when not paused. Scale zero stops it; negative scale runs backwards. Full Day Duration is in game seconds.

Curves and time ownership#

Use Unscaled Time makes clock progression/visual smoothing use real elapsed time while Time.timeScale = 0; it does not change every other effect's timing. Daylight Curve shapes the zero-to-one daylight response without changing clock speed.

When saved-game time or a transition owns the clock, disable Automatic or pause it. SetTime(hour, false) suppresses all events. SetTime uses the signed difference to the wrapped target; use AdvanceHours(3) to advance three hours across midnight.

Events#

EventCallback
Sunrise / SunsetConfigured boundary crossing.
Day / Night StartedEntry into a day/night phase.
Time Changed (Single)Current hour as a float.

In Advanced, add a UnityEvent listener, assign the scene callback object and choose its public method. For Time Changed, use Dynamic float; static float sends a fixed value. Test crossing sunrise/sunset in Play Mode. Boundary events fire at most once per update, even for multi-day skips.

GuideClockEvents shows paired C# subscriptions. Turning Automatic off and changing Hour alone does not recolor artwork; enable Environment colors.

Adapted from the supplied guide · PDF pages 12–13.View source guide ↗
Keep creating.ERAGAN STUDIO.

Search a topic, setting or method across all package guides.