RealDocs

ACharacter::OnRep_ReplicatedMovement

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

Description

Override of AActor::OnRep_ReplicatedMovement that additionally handles character-specific movement updates such as movement mode and based movement when the replicated transform is received.

Caveats & Gotchas

  • ACharacter overrides this to handle the FRepMovement update alongside based movement; calling Super is important to preserve this additional logic when further overriding.
  • This fires on simulated proxies when the actor's FRepMovement struct is replicated, which may not happen every tick — position updates can be batched or skipped if the character has not moved.
  • On dedicated servers and autonomous proxies this does not fire; network-corrected position is handled through a separate path in CharacterMovementComponent.

Signature

ENGINE_API virtual void OnRep_ReplicatedMovement() override

Return Type

void

Example

Override to detect teleports via large position delta C++
void AMyCharacter::OnRep_ReplicatedMovement()
{
    FVector OldLoc = GetActorLocation();
    Super::OnRep_ReplicatedMovement();
    float DeltaDist = FVector::Dist(OldLoc, GetActorLocation());
    if (DeltaDist > 1000.f)
    {
        // Large delta — likely a server-forced teleport
        OnTeleportDetected();
    }
}

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.