UGameplayStatics::RebaseLocalOriginOntoZero
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticBlueprintPure
Description
Converts a local world-space position (relative to the current shifted origin) into an absolute origin-based position suitable for storage or network transmission. The inverse of RebaseZeroOriginOntoLocal.
Caveats & Gotchas
- • The naming is counterintuitive: 'local' here refers to the shifted coordinate system, not object-local space — the result is the absolute integer-origin-based position.
- • This is a pure math operation using the current origin at the time of the call; if the origin shifts again before you use the result, the stored value will be incorrect.
- • Intended for serialization and networking where positions must be expressed relative to a known fixed origin rather than the current shifted origin.
Signature
static ENGINE_API FVector RebaseLocalOriginOntoZero(UObject* WorldContextObject, FVector WorldLocation); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | UObject* | Any UObject within the world to provide world context. | — |
| WorldLocation | FVector | A location expressed relative to the current shifted world origin. | — |
Return Type
FVector Example
Serialize actor position for network replication C++
// Convert current actor position to absolute coords before sending over network
FVector AbsolutePos = UGameplayStatics::RebaseLocalOriginOntoZero(this, TrackedActor->GetActorLocation());
SendPositionToServer(AbsolutePos); See Also
Tags
Version History
Introduced in: 4.5
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?