Time Manager

World clock management, time-of-day control, day/night cycle detection, and per-tick time notifications.

The Time Manager is the singleton world clock for every GS_Play project. It extends GS_ManagerComponent and participates in the standard two-stage initialization managed by the Game Manager. On activation it begins advancing a time-of-day value each frame, determines whether the current time falls within the configured day window, and registers the active main camera for sky positioning calculations.

Listeners subscribe to TimeManagerNotificationBus to react to per-frame ticks or the day/night boundary crossing.

For usage guides and setup examples, see The Basics: Time Manager.

Time Manager component in the O3DE Inspector

 

Contents


How It Works

Time Progression

Each frame the Time Manager advances the current time-of-day value by deltaTime × timePassageSpeed. A speed of 0 freezes the clock at the configured initial time; positive values run the clock forward in real time.

Day/Night State

The Time Manager compares the current time against a configured day window (start and end values). When the time crosses either threshold it fires DayNightChanged once. IsDay() returns the cached state and is safe to call every tick.

Sky Integration

Call SetMainCam with the active camera entity after stage startup. The Time Manager uses this reference to pass sky positioning data to the SkyColourConfiguration asset used by the Atom renderer.


Inspector Properties

PropertyTypeDescription
Day StartfloatNormalized time value (0.0–1.0) at which day begins.
Day EndfloatNormalized time value (0.0–1.0) at which night begins.
Initial TimefloatStarting time-of-day value when the component activates.
Time Passage SpeedfloatMultiplier controlling how fast time advances each frame. Set to 0 for a static clock.
Sky Colour ConfigAZ::Data::Asset<SkyColourConfiguration>Sky colour configuration asset used by the Atom renderer integration.

API Reference

GS_TimeManagerComponent

FieldValue
ExtendsGS_Core::GS_ManagerComponent
HeaderGS_Environment/GS_TimeManagerBus.h

Request Bus: TimeManagerRequestBus

Commands sent to the Time Manager. Singleton bus – Single address, single handler.

MethodParametersReturnsDescription
SetTimeOfDayfloat timevoidSets the current time of day (0.0–1.0 normalized range).
GetTimeOfDayfloatReturns the current time of day value.
GetWorldTimefloatReturns the total elapsed world time since startup.
SetTimePassageSpeedfloat speedvoidSets the multiplier controlling how fast time advances each frame.
IsDayboolReturns whether the current time falls within the configured day window.
SetMainCamAZ::EntityId entityIdvoidRegisters the active main camera entity for sky positioning calculations.

Notification Bus: TimeManagerNotificationBus

Events broadcast by the Time Manager. Multiple handler bus – any number of components can subscribe.

EventParametersDescription
WorldTickfloat deltaTimeFired every frame while the Time Manager is active. Use for time-dependent per-frame updates.
DayNightChangedbool isDayFired once when the time-of-day crosses the day/night boundary in either direction.

SkyColourConfiguration

Asset class for sky colour settings. Referenced by GS_TimeManagerComponent and consumed by the Atom renderer integration to drive sun, moon, and ambient colour values across the day/night cycle.


See Also

For conceptual overviews and usage guides:

For component references:


Get GS_Environment

GS_Environment — Explore this gem on the product page and add it to your project.