UGameplayStatics::GetWorldOriginLocation
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns the current world origin location as an integer vector in world space. Used when working with large open worlds that employ world origin shifting to keep floating-point coordinates near zero.
Caveats & Gotchas
- • Returns an FIntVector in centimeters like all UE coordinates, but the integer type loses sub-centimeter precision — suitable for origin queries but not for precise per-frame math.
- • When world origin shifting is not enabled (the default for most projects), this always returns (0,0,0); do not rely on it being non-zero unless you explicitly call SetWorldOriginLocation.
- • After an origin shift, previously stored FVector world positions are stale and must be rebased using RebaseLocalOriginOntoZero or RebaseZeroOriginOntoLocal.
Signature
static ENGINE_API FIntVector GetWorldOriginLocation(const UObject* WorldContextObject); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Any UObject within the world to provide world context. | — |
Return Type
FIntVector Example
Read current world origin C++
FIntVector Origin = UGameplayStatics::GetWorldOriginLocation(this);
UE_LOG(LogTemp, Log, TEXT("World origin: %s"), *Origin.ToString()); See Also
Version History
Introduced in: 4.5
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?