ACharacter::SetReplicateMovement
#include "GameFramework/Character.h"
Access: public
Specifiers: virtual
Description
Enables or disables movement replication for this character. Overrides AActor::SetReplicateMovement to also update the CharacterMovementComponent's replication state.
Caveats & Gotchas
- • Disabling movement replication stops position/rotation updates from being sent to simulated proxies, but the character remains in the world — proxies will freeze at their last received transform until replication is re-enabled.
- • This override also updates bReplicateMovement on the CharacterMovementComponent itself; calling the AActor base version directly bypasses this and can leave the movement component out of sync.
- • Must be called on the server or on a locally controlled pawn; calling it on a simulated proxy has no network effect.
Signature
ENGINE_API virtual void SetReplicateMovement(bool bInReplicateMovement) override Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| bInReplicateMovement | bool | True to replicate movement to clients, false to stop replication. | — |
Return Type
void Example
Disable movement replication for a ragdoll C++
// Called server-side when switching to physics ragdoll
void AMyCharacter::EnableRagdoll()
{
GetMesh()->SetSimulatePhysics(true);
// Stop sending transform updates — ragdoll is physics-driven on all clients
SetReplicateMovement(false);
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?