RealDocs

UCharacterMovementComponent::MaybeSaveBaseLocation

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

Description

Calls SaveBaseLocation() unless bDeferUpdateBasedMovement is set, in which case the save is skipped for this tick.

Caveats & Gotchas

  • The 'maybe' is entirely controlled by bDeferUpdateBasedMovement — if that flag is true, OldBaseLocation and OldBaseQuat silently do not update this tick, which can cause based-rotation logic to see stale data.
  • Intended to be called at the natural points in the movement update where a based-location save is normally due; calling it more often than the engine does won't cause harm but also won't do anything extra beyond what SaveBaseLocation() does.
  • Prefer SaveBaseLocation() directly if you need to guarantee the base location is refreshed regardless of the defer flag.

Signature

virtual void MaybeSaveBaseLocation();

Return Type

void

Example

Calling the deferred-aware save from custom movement code C++
void UMyCharacterMovementComponent::PerformCustomBaseSync()
{
	// Respects bDeferUpdateBasedMovement, unlike SaveBaseLocation().
	MaybeSaveBaseLocation();
}

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.