RealDocs

AActor::SetReplicatedMovement

function Engine Since unknown
#include "GameFramework/Actor.h"
Access: public

Description

Replaces the actor's ReplicatedMovement struct wholesale. Used by the engine's movement replication path to inject an incoming network snapshot.

Caveats & Gotchas

  • Calling this manually on the server does not automatically trigger a net update — the struct will only reach clients when the actor is next considered for replication according to NetUpdateFrequency.
  • Does not fire OnRep_ReplicatedMovement on the machine that called this function, only on receiving clients — do not assume any corrections happen locally.
  • Overwrites the entire struct including flags like bRepPhysics and bSimulatedPhysicSleep; ensure the incoming struct has all fields correctly populated before calling.

Signature

ENGINE_API void SetReplicatedMovement(const FRepMovement& InReplicatedMovement)

Parameters

Name Type Description Default
InReplicatedMovement const FRepMovement& The FRepMovement struct to assign, containing location, rotation, and velocity.

Return Type

void

Example

Manually inject a corrected movement snapshot from a custom net driver C++
void AMyActor::ApplyServerCorrection(const FRepMovement& CorrectedState)
{
    // Only valid to call on authority or during replication callbacks
    if (HasAuthority())
    {
        SetReplicatedMovement(CorrectedState);
        ForceNetUpdate();
    }
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.