BP-CAST-001

WarningBlueprintDynamic Cast Chain

Flags Blueprints with multiple dynamic casts to other Blueprint classes. The real cost isn’t the cast itself—it’s the hard reference that forces the target Blueprint to load when the casting Blueprint loads.


Why It Matters

Casting has two separate costs:

CostWhenImpact
RuntimeEach cast executes~0.05ms (minor)
LoadCasting Blueprint loadsMBs of memory (major)

The key insight: Casting to BP_Enemy embeds a hard reference. When your Blueprint loads, BP_Enemy + all its dependencies load too—even if the cast never runs.


When It’s Acceptable


The Fix

Before: Get Actor → Cast to BP_Enemy → Call TakeDamage
After:  Get Actor → Does Implement Interface? → Call TakeDamage (Message)

No hard reference to the implementation class.

Option 2: Cache Cast Results

Cast once in BeginPlay, store the result.

Option 3: C++ Base Class

Cast to a C++ parent class instead of the Blueprint child.


Configuration

Project Settings → Blueprint Health Analyzer → BP-CAST-001 → 6.0