RealDocs

AActor::SetReplicatingMovement

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

Description

Sets whether this actor's movement (location, rotation, velocity) is replicated to clients. When enabled, the engine uses the FRepMovement struct to sync physics and transform state across the network.

Caveats & Gotchas

  • Only has effect when called on the server (authority); clients cannot toggle this themselves.
  • Enabling movement replication for actors that also use a UCharacterMovementComponent can cause conflicts — CMC has its own movement sync path and setting this flag simultaneously may produce double-correction artefacts.
  • Setting this at runtime after gameplay has started may not retroactively sync the actor's current position to clients until the next net update cycle.

Signature

ENGINE_API void SetReplicatingMovement(bool bInReplicateMovement)

Parameters

Name Type Description Default
bInReplicateMovement bool Whether to enable movement replication for this actor.

Return Type

void

Example

Enable movement replication on a spawned projectile C++
void AMyGameMode::SpawnProjectile()
{
    AMyProjectile* Proj = GetWorld()->SpawnActor<AMyProjectile>(ProjectileClass, SpawnLocation, SpawnRotation);
    if (Proj)
    {
        Proj->SetReplicates(true);
        Proj->SetReplicatingMovement(true);
    }
}

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.