UGameplayStatics::GetAudioTimeSeconds
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns time in seconds since the world was brought up for play, stopped when the game is paused, and not dilated or clamped by time dilation. Use this for audio synchronization where pausing the game should also pause audio-driven timers.
Caveats & Gotchas
- • Unlike GetTimeSeconds, this timer stops when the game is paused — making it unsuitable for real-time UI countdowns that should continue while paused.
- • Not affected by time dilation (e.g. slow-motion effects), so audio triggered via this time will desync from dilated gameplay events.
- • Returns 0 if called before the world has started play.
Signature
static ENGINE_API double GetAudioTimeSeconds(const UObject* WorldContextObject); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Any UObject within the world to provide world context. | — |
Return Type
double Example
Schedule audio-synchronized event C++
double AudioTime = UGameplayStatics::GetAudioTimeSeconds(this);
if (AudioTime - LastBeatTime >= BeatInterval)
{
LastBeatTime = AudioTime;
TriggerBeatEvent();
} See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?