RealDocs

UCharacterMovementComponent::OldBaseLocation

property Engine Since 4.0
#include "GameFramework/CharacterMovementComponent.h"
Access: public Specifiers: UPROPERTYTransient

Description

Stores the world-space location of the object the character was standing on as of the last base update, so UpdateBasedMovement() can detect whether the base moved this frame.

Caveats & Gotchas

  • Transient and not exposed to Blueprint — this is purely internal bookkeeping used by the based-movement system, not a value you should read or write directly.
  • Only meaningful while the character actually has a valid MovementBase; it is not cleared to a sentinel value when the base is lost, so don't rely on it to detect 'no base'.
  • Updated by SaveBaseLocation() and MaybeSaveBaseLocation(), not written to every tick — check those functions if OldBaseLocation appears stale in a custom movement subclass.

Signature

FVector OldBaseLocation;

Return Type

FVector

Example

Detecting base movement in a custom subclass C++
void UMyCharacterMovementComponent::UpdateBasedMovement(float DeltaSeconds)
{
	const FVector PreviousBaseLocation = OldBaseLocation;
	Super::UpdateBasedMovement(DeltaSeconds);

	if (MovementBaseUtility::IsDynamicBase(GetMovementBase()) && !PreviousBaseLocation.Equals(OldBaseLocation))
	{
		UE_LOG(LogTemp, Verbose, TEXT("Base moved this frame."));
	}
}

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.