AActor::IsReplayRelevantFor
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtualconst
Description
Determines whether this actor should be recorded into a replay for a given viewer. Mirrors IsNetRelevantFor but for the replay recording path, with an additional explicit cull distance parameter.
Caveats & Gotchas
- • Unlike IsNetRelevantFor, the cull distance is passed explicitly rather than derived from AGameNetworkManager settings — make sure your override uses CullDistanceSquared rather than a hardcoded constant.
- • Returning false here permanently excludes the actor from the replay stream for that viewer; data cannot be retroactively inserted, so err on the side of inclusion if unsure.
Signature
ENGINE_API virtual bool IsReplayRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation, const float CullDistanceSquared) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| RealViewer | const AActor* | The controlling net object associated with the client for which replay relevancy is being checked. | — |
| ViewTarget | const AActor* | The actor used as the point of view for the RealViewer during replay playback. | — |
| SrcLocation | const FVector& | The viewing location used for relevancy checks. | — |
| CullDistanceSquared | const float | Squared cull distance; actors beyond this are considered irrelevant. | — |
Return Type
bool Example
Exclude transient FX actors from replays C++
bool AMyFXActor::IsReplayRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation, const float CullDistanceSquared) const
{
// Never record short-lived VFX into replays
return false;
} See Also
Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?