RealDocs

UGameplayStatics::GetWorldDeltaSeconds

function Engine Blueprint Since 4.0
#include "Kismet/GameplayStatics.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Returns the elapsed time in seconds since the last frame, scaled by time dilation. This is the frame delta most gameplay logic should use for frame-rate-independent movement.

Caveats & Gotchas

  • The return type changed from float to double in UE 5.1; code that stores the result in a float will silently lose precision — use double or auto.
  • When the game is paused, this returns 0 (or the paused delta); if you need delta time that advances even while paused, use GetUnpausedTimeSeconds differences instead.

Signature

static ENGINE_API double GetWorldDeltaSeconds(const UObject* WorldContextObject);

Parameters

Name Type Description Default
WorldContextObject const UObject* Object used to resolve the current world.

Return Type

double

Example

Move an actor at a fixed world speed C++
void AMyActor::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);
    // Prefer using the Tick DeltaTime parameter directly, but GetWorldDeltaSeconds
    // is useful from non-Tick contexts (e.g. a timer callback).
    double Delta = UGameplayStatics::GetWorldDeltaSeconds(this);
    SetActorLocation(GetActorLocation() + GetActorForwardVector() * Speed * Delta);
}

Tags

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.