RealDocs

UCharacterMovementComponent::SendClientAdjustment

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

Description

Server-side hook from INetworkPredictionInterface that dispatches a pending correction to the owning client if GetPredictionData_Server_Character()->bForceClientUpdate or ServerCheckClientError() indicate one is needed.

Caveats & Gotchas

  • Part of the INetworkPredictionInterface server hook chain — it's called automatically from the movement replication pipeline, not something you typically call directly.
  • Requires valid server prediction data; if HasPredictionData_Server() is false there is nothing to send, since the function relies on state tracked there.
  • Only sends a correction when needed — calling it does not unconditionally push a correction to the client the way it might sound.

Signature

virtual void SendClientAdjustment() override

Return Type

void

Example

Overriding to log corrections C++
void UMyCharacterMovementComponent::SendClientAdjustment()
{
	if (HasPredictionData_Server() && GetPredictionData_Server_Character()->bForceClientUpdate)
	{
		UE_LOG(LogTemp, Verbose, TEXT("Sending forced client adjustment for %s"), *GetNameSafe(CharacterOwner));
	}
	Super::SendClientAdjustment();
}

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.