RealDocs

UCharacterMovementComponent::ApplyWorldOffset

function Engine Since 4.0
#include "GameFramework/CharacterMovementComponent.h"
Access: public Specifiers: virtualoverride

Description

Shifts internal movement-tracking state (OldBaseLocation, LastUpdateLocation, and any saved client moves) by the given offset when the world origin is rebased.

Caveats & Gotchas

  • Only adjusts saved client moves for locally controlled autonomous proxies; simulated proxies and the server rely on other replication paths to stay in sync.
  • You should not call this directly — it's invoked automatically by the engine's origin-rebasing system via UActorComponent::ApplyWorldOffset when the world origin shifts.

Signature

virtual void ApplyWorldOffset(const FVector& InOffset, bool bWorldShift) override

Parameters

Name Type Description Default
InOffset const FVector& World-space offset being applied to shift the origin.
bWorldShift bool True when this call is part of a full world origin shift.

Return Type

void

Example

Tracking a custom location through origin shifts C++
void UMyCharacterMovementComponent::ApplyWorldOffset(const FVector& InOffset, bool bWorldShift)
{
    Super::ApplyWorldOffset(InOffset, bWorldShift);
    CustomTrackedLocation += InOffset;
}

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.