AActor::IsRelevancyOwnerFor
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtual
Description
Determines whether this actor should be considered the relevancy owner for a given replicated actor on a given connection. Used when the replicated actor has bOnlyRelevantToOwner=true.
Caveats & Gotchas
- • Only consulted when ReplicatedActor->bOnlyRelevantToOwner is true — otherwise standard distance/visibility relevancy applies.
- • The default implementation checks this == ActorOwner; override when ownership chains don't map directly to connection ownership (e.g., a vehicle containing a player controller).
- • Returning true here makes the actor relevant for that connection for the entire frame — there is no per-tick cost after the relevancy decision is made.
Signature
ENGINE_API virtual bool IsRelevancyOwnerFor(const AActor* ReplicatedActor, const AActor* ActorOwner, const AActor* ConnectionActor) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ReplicatedActor | const AActor* | The actor whose relevancy is being evaluated. | — |
| ActorOwner | const AActor* | The current owner of ReplicatedActor. | — |
| ConnectionActor | const AActor* | The controller representing the connection being tested. | — |
Return Type
bool Example
Make a team manager relevant to all team member connections C++
bool ATeamManager::IsRelevancyOwnerFor(
const AActor* ReplicatedActor,
const AActor* ActorOwner,
const AActor* ConnectionActor) const
{
// Relevant to any connection whose controller is on the same team
if (const APlayerController* PC = Cast<APlayerController>(ConnectionActor))
{
return GetTeamIndex() == GetTeamIndexForController(PC);
}
return Super::IsRelevancyOwnerFor(ReplicatedActor, ActorOwner, ConnectionActor);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?