RealDocs

UGameplayStatics::SetWorldOriginLocation

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

Description

Requests a shift of the world origin to the given integer location. This rebases all actor positions relative to the new origin, keeping floating-point coordinates near zero in very large open worlds.

Caveats & Gotchas

  • The shift is not applied immediately — it is queued and processed by the world at an appropriate time; do not assume the origin has moved within the same frame as the call.
  • All actor FVector positions are automatically rebased by the engine after the shift, but any FVector values cached in local variables or custom data structures will become stale and must be manually updated with the Rebase helpers.
  • World origin shifting can cause physics artefacts for actors mid-simulation during the shift; avoid calling this while large physics simulations are active.

Signature

static ENGINE_API void SetWorldOriginLocation(const UObject* WorldContextObject, FIntVector NewLocation);

Parameters

Name Type Description Default
WorldContextObject const UObject* Any UObject within the world to provide world context.
NewLocation FIntVector The new world origin position in integer world-space centimeters.

Return Type

void

Example

Shift origin to follow the player in a large world C++
FVector PlayerPos = PlayerPawn->GetActorLocation();
FIntVector CurrentOrigin = UGameplayStatics::GetWorldOriginLocation(this);
FIntVector NewOrigin = CurrentOrigin + FIntVector(PlayerPos);
UGameplayStatics::SetWorldOriginLocation(this, NewOrigin);

Version History

Introduced in: 4.5

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.