ACharacter::PreReplicationForReplay
#include "GameFramework/Character.h"
Access: public
Specifiers: virtualoverrideENGINE_API
Description
Called for all actors when recording a Client Replay, including simulated proxies. Allows ACharacter to package replay-specific replication data that differs from normal server replication.
Caveats & Gotchas
- • Unlike PreReplication, this is called on all net roles when recording a replay (not just the server/autonomous proxy). Logic here runs for simulated proxies too — do not assume net authority.
- • Replay recording can cause this to fire at a high rate depending on the replay sample rate. Expensive operations in this function will have a measurable CPU cost during replay recording sessions.
Signature
ENGINE_API virtual void PreReplicationForReplay(IRepChangedPropertyTracker& ChangedPropertyTracker) override; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ChangedPropertyTracker | IRepChangedPropertyTracker& | Tracks which properties should be recorded into the replay stream for this actor. | — |
Return Type
void Example
Override to include custom data in replay captures C++
void AMyCharacter::PreReplicationForReplay(IRepChangedPropertyTracker& ChangedPropertyTracker)
{
Super::PreReplicationForReplay(ChangedPropertyTracker);
// Capture current cosmetic state for replay playback
ReplayCosmeticState = CurrentCosmeticState;
} Version History
Introduced in: 4.16
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?