RealDocs

AActor::GetReplicatedMovement_Mutable

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

Description

Returns a mutable reference to the actor's replicated movement struct, intended for cases where the struct must be modified in place — primarily by the engine's replication machinery.

Caveats & Gotchas

  • Modifying the struct through this reference does not automatically mark the property dirty for replication; you must call MarkPropertyDirty or ensure the actor's NetDirtyProperties are tracked, otherwise the change will not propagate to clients.
  • This function exists to facilitate the eventual privatisation of the ReplicatedMovement member — it is a transitional API and may be removed or restricted in future engine versions.
  • Prefer SetReplicatedMovement when setting the full struct; use this only when you need to modify a single field in-place inside a replication callback.

Signature

ENGINE_API FRepMovement& GetReplicatedMovement_Mutable()

Return Type

FRepMovement&

Example

Patch velocity inside a custom movement replication path C++
void AMyNetActor::GatherCurrentMovement()
{
    Super::GatherCurrentMovement();
    FRepMovement& RepMove = GetReplicatedMovement_Mutable();
    // Clamp replicated velocity for bandwidth reasons
    RepMove.LinearVelocity = RepMove.LinearVelocity.GetClampedToMaxSize(2000.f);
}

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.