AActor::ForcePropertyCompare
#include "GameFramework/Actor.h"
Access: public
Specifiers: ENGINE_API
Description
Forces all replicated properties on this actor to do a full comparison against their shadow state for one frame, rather than relying on the shared dirty-tracking state. Use when you know a property changed but replication might have missed it.
Caveats & Gotchas
- • This is a one-frame operation — it forces a compare on the next replication pass only, after which the actor returns to normal shadow-state-based dirty tracking.
- • Calling this frequently (e.g. every frame) defeats the purpose of UE's replication optimization and will degrade network performance. Use it only when recovering from a known state divergence.
- • SetAutonomousProxy() calls this internally with bAllowForcePropertyCompare=true, which is the canonical engine use case — study that as a model before rolling your own usage.
Signature
ENGINE_API void ForcePropertyCompare() Return Type
void Example
Force a property re-compare after manual state correction C++
// After correcting replicated state that may have diverged:
void AMyActor::CorrectReplicatedState()
{
MyReplicatedValue = GetCorrectedValue();
ForcePropertyCompare(); // Ensure the correction is sent to clients this frame
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?