UGameplayStatics::GetUnpausedTimeSeconds
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns elapsed time in seconds since the world started, adjusted by time dilation but continuing to advance while the game is paused. Use this for UI timers, replays, or anything that should keep ticking during a pause menu.
Caveats & Gotchas
- • Still subject to time dilation — slow-motion will slow this clock. Use GetRealTimeSeconds if you need a clock unaffected by both pause and dilation.
- • The distinction from GetTimeSeconds is only relevant when the game is actively paused; during normal gameplay both return identical values.
Signature
static ENGINE_API double GetUnpausedTimeSeconds(const UObject* WorldContextObject); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Object used to resolve the current world. | — |
Return Type
double Example
Animate a pause menu timer C++
// Animate a spinning icon in the pause menu using unpaused time.
void UMyPauseWidget::NativeTick(const FGeometry& Geometry, float InDeltaTime)
{
Super::NativeTick(Geometry, InDeltaTime);
double T = UGameplayStatics::GetUnpausedTimeSeconds(GetWorld());
SpinnerImage->SetRenderTransformAngle(FMath::Fmod(T * 180.0, 360.0));
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?