UGameplayStatics::SetGlobalTimeDilation
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Sets the global time dilation, scaling how fast time advances for the entire game world. Useful for slow-motion effects or cinematic sequences.
Caveats & Gotchas
- • This affects all actors and timers in the world — not per-actor. If you only want to slow a specific actor, set Actor::CustomTimeDilation on that actor instead.
- • Values very close to 0 can cause floating-point instability in physics and animation. Keep TimeDilation above 0.0001 in practice.
- • Not replicated. Clients must set their own dilation independently, or you must broadcast this call through a network RPC.
Signature
static ENGINE_API void SetGlobalTimeDilation(const UObject* WorldContextObject, float TimeDilation); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Object used to retrieve the world context. | — |
| TimeDilation | float | Multiplier applied to global game time. 1.0 = normal speed, 0.5 = half speed, 2.0 = double speed. | — |
Return Type
void Example
Bullet-time slow motion on hit C++
// Slow the world to 20% speed for 0.5 seconds, then restore
UGameplayStatics::SetGlobalTimeDilation(this, 0.2f);
FTimerHandle Handle;
GetWorldTimerManager().SetTimer(Handle, [this]()
{
UGameplayStatics::SetGlobalTimeDilation(this, 1.0f);
}, 0.5f, false); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?