diff --git a/Source/Nakatomi/ExplosiveActor.cpp b/Source/Nakatomi/ExplosiveActor.cpp index 70103b8..1413bf6 100644 --- a/Source/Nakatomi/ExplosiveActor.cpp +++ b/Source/Nakatomi/ExplosiveActor.cpp @@ -48,7 +48,9 @@ void AExplosiveActor::Explode() for (FOverlapResult Overlaps : outOverlaps) { - if (auto healthComponent = Overlaps.GetActor()->GetComponentByClass()) + UHealthComponent* healthComponent = Overlaps.GetActor()->GetComponentByClass(); + + if (healthComponent) { float distance = FVector::Distance(ActorToWorld().GetLocation(), Overlaps.GetActor()->ActorToWorld().GetLocation());