RealDocs

AActor::GetNetCullDistanceSquared

function Engine Blueprint Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: UFUNCTION

Description

Returns the squared net cull distance for this actor. Take the square root to get the distance in Unreal Units at which the actor stops being replicated to distant clients.

Caveats & Gotchas

  • The returned value is in squared Unreal Units — do not compare it directly to unsquared distances. `FMath::Sqrt(GetNetCullDistanceSquared())` gives the real-world cull radius.
  • Returns the current runtime value, which may differ from the class default if `SetNetCullDistanceSquared` was called at runtime. The default is defined per class in its CDO.

Signature

ENGINE_API float GetNetCullDistanceSquared() const

Return Type

float

Example

Log the effective cull distance C++
void AMyActor::BeginPlay()
{
    Super::BeginPlay();
    float CullDist = FMath::Sqrt(GetNetCullDistanceSquared());
    UE_LOG(LogNet, Log, TEXT("%s cull distance: %.0f UU"), *GetName(), CullDist);
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable
5.5 stable Added as the canonical getter after direct UPROPERTY access was deprecated.

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.