text
stringlengths
0
17.2k
Use caution when overriding AActor::IsNetRelevantFor. This may have unintended consequences if you are not familiar with Unreal Engine's replication system.
The virtual function AActor::IsNetRelevantFor implements several tests to determine the set of actors that are relevant to a connection.
AActor::IsNetRelevantFor uses three parameters to determine whether the calling actor object is relevant:
For a given actor and connection, the following tests are performed:
If the current actor has no root component, then AActor::IsNetRelevantFor logs a warning and asks if the actor should be always relevant.
This relevancy logic is for the base AActor class. Other AActor-derived classes may contain different network relevancy logic. For example, the APawn and APlayerController classes override AActor::IsNetRelevantFor. Therefore, they have different conditions for relevancy. See Pawn.cpp and PlayerController.cpp for more information.
You can customize network relevancy settings for your AActor-derived class in the Replication section of the Unreal Editor Details Panel or in C++.
Obtain an Actor’s Relevancy
How Relevancy is Determined
Customize Relevancy Settings
Relevancy Reference
Make an Actor Relevant
Override Actor Relevancy
Parameters
Relevancy Logic
Functions
Properties
RealViewer
Client network object controlling the current actor for which relevancy is being checked. This is usually a Player Controller.
ViewTarget
Actor currently viewed or controlled by RealViewer. This is usually a Pawn.
SrcLocation
Source location of the controlling network object. This is used when distance-based relevancy is enabled.
ForceNetRelevant
Force this actor to be network relevant if it is not already relevant by default.
IsNetRelevantFor
Check if this actor is relevant for a specific network connection.
IsRelevancyOwnerFor
Check if this actor is the owner when performing network relevancy checks for actors marked bOnlyRelevantToOwner.
IsReplayRelevantFor
Check if this actor is relevant for recorded replay.
IsWithinNetRelevancyDistance
Check if the square of the distance between the given source location and this actor’s location is within NetCullDistanceSquared.
bAlwaysRelevant
Always relevant for network replication. Overrides bOnlyRelevantToOwner.
bNetUseOwnerRelevancy
If this actor has a valid owner, call the owner's IsNetRelevantFor and GetNetPriority.
bOnlyRelevantToOwner
If true, this actor is only relevant to its owner.
bRelevantForNetworkReplays
If true, this actor is replicated to network replays. Default true.
NetCullDistanceSquared
Square of the maximum distance from the client’s viewport that this actor is relevant and replicates.
Owner
Owner of this actor. Used for replication with bNetUseOwnerRelevancy and bOnlyRelevantToOwner.
Remarks
The following tables provide functions and properties pertaining to actor relevancy that can be found in theAActorclass:
Animation Slots
As you create more complex Animation behavior for your characters, it may be necessary to create proxy areas in your Animation Blueprint where you can insert one-off animations. This can be accomplished by using Slots, which are nodes that you can add to your Animation Blueprint at various points to layer and play animations into. Slots are mainly used together with Animation Montages, however they can also be used with Sequencer.
This document provides an overview of how to create and use Animation Slots in your Animation Blueprint, Montages, and Sequencer.