RealDocs

UCharacterMovementComponent::GetLastServerMovementBase

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

Description

Returns the movement base the character was standing on as of the last processed server move. Only relevant during server-side movement update and correction processing.

Caveats & Gotchas

  • Only useful during server movement replication and correction — it reflects LastServerMovementBase, which is written when the server acknowledges a client's ServerMove(), not the character's currently cached MovementBase.
  • On a client, or before any server move has been processed, this typically returns null or a stale value since LastServerMovementBase is only updated by server-side move-acknowledgment code.

Signature

UPrimitiveComponent* GetLastServerMovementBase() const { return LastServerMovementBase.Get(); }

Return Type

UPrimitiveComponent*

Example

Detect a base lift-off on the server C++
if (!MovementBase && GetLastServerMovementBase())
{
	// The character was on a base last tick but isn't now - treat as lift-off.
	HandleBaseLiftOff();
}

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.