BP-GETALL-001

WarningBlueprintWorld Query

Flags GetAllActorsOfClass and similar world queries. Cost scales with total actor count in the world, not matching count. Epic’s API docs explicitly warn about performance.


Why It Matters

Epic’s official warning: “GetAllActorsOfClass will be slow when there are many actors.”

FunctionIterates500 Actors
GetAllActorsOfClassClass hierarchy~0.08ms
GetAllActorsWithTagALL actors~0.20ms
GetAllActorsWithInterfaceALL actors~0.25ms

Tag/Interface variants are 2-3× slower—they check every single actor.


When It’s Acceptable


The Fix

Actors announce themselves instead of being searched for:

// BP_Pickup BeginPlay:
Get GameMode → Call RegisterPickup(self)

// BP_Pickup EndPlay:
Get GameMode → Call UnregisterPickup(self)

// GameMode maintains ActivePickups array
// Any query: just return the array (O(1) vs O(n))

Option 2: Cache Results

Query once in BeginPlay, store in variable.

Option 3: Spatial Queries

For “find nearby”, use SphereOverlap instead—uses spatial acceleration.


Context Severity

ContextFrequencySeverity
Event Tick60/secCritical
Fast Timer (under 0.1s)10+/secCritical
Timer (0.5s)2/secWarning
BeginPlayOnceInfo

Configuration

Project Settings → Blueprint Health Analyzer → BP-GETALL-001 → 2.0