AActor::PreReplicationForReplay
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtual
Description
Called before replication when recording a client replay, including for simulated proxies. Mirrors PreReplication but covers all net roles during replay, not just the server.
Caveats & Gotchas
- • Only invoked when bCallPreReplicationForReplay is true. Enable via SetCallPreReplicationForReplay(true) if you need this callback.
- • Called on all connections during replay recording — including simulated proxies — which is broader than PreReplication. Be mindful of this when setting conditions.
- • Replay recording can run at the same tick as normal replication; avoid side effects that assume only one of these is called per frame.
Signature
ENGINE_API virtual void PreReplicationForReplay(IRepChangedPropertyTracker & ChangedPropertyTracker) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ChangedPropertyTracker | IRepChangedPropertyTracker & | Tracker for conditional property replication during replay recording. | — |
Return Type
void Example
Override conditions specifically for replays C++
void AMyActor::PreReplicationForReplay(IRepChangedPropertyTracker& ChangedPropertyTracker)
{
Super::PreReplicationForReplay(ChangedPropertyTracker);
// Always replicate debug data during replays
DOREPLIFETIME_ACTIVE_OVERRIDE(AMyActor, DebugState, true);
} Tags
Version History
Introduced in: 4.13
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?