UGameplayStatics::GetGlobalTimeDilation
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the current global time dilation factor for the world. A value of 1.0 is normal speed; values below 1.0 slow down all gameplay, and values above 1.0 speed it up.
Caveats & Gotchas
- • Global time dilation affects physics, animations, particle systems, and timer callbacks, but does not affect real-world wall-clock time or UI animations driven by platform ticks.
- • The effective dilation applied to any individual actor is the product of the global dilation and the actor's own CustomTimeDilation. GetGlobalTimeDilation only returns the world-level factor.
- • In networked games, time dilation is server-authoritative. Clients may observe interpolated values that lag slightly behind the server's current setting.
Signature
static ENGINE_API float GetGlobalTimeDilation(const UObject* WorldContextObject); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Any object in the world to use as context. | — |
Return Type
float Example
Log the current time dilation before applying a bullet-time effect C++
float CurrentDilation = UGameplayStatics::GetGlobalTimeDilation(this);
UE_LOG(LogGame, Log, TEXT("Current time dilation: %.3f"), CurrentDilation);
// Apply slow motion
UGameplayStatics::SetGlobalTimeDilation(this, 0.2f); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?