RealDocs

UCharacterMovementComponent::ForceReplicationUpdate

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

Description

Forces a client movement update by making the server behave as though the client hasn't sent an update in a long time, so the next replication check is guaranteed to fire.

Caveats & Gotchas

  • Server-only in effect — it manipulates server-side replication timers, so calling it on a client does nothing useful.
  • This forces the check to run, it does not guarantee a correction is sent; ServerCheckClientError() still decides whether the client's position is actually out of tolerance.
  • Useful right after teleports or forced position changes where you need clients to reconcile immediately instead of waiting for the normal replication cadence.

Signature

virtual void ForceReplicationUpdate()

Return Type

void

Example

Forcing sync after a server-side teleport C++
void AMyCharacter::TeleportToSafeLocation(const FVector& NewLocation)
{
	SetActorLocation(NewLocation);
	if (HasAuthority())
	{
		GetCharacterMovement()->ForceReplicationUpdate();
	}
}

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.