How to apply radial damage to all actors in the area?

Hello, Davixe

In this situation, you can do the following:

  1. Iterate amongst all actors of particular class.

  2. Check each actor for distance and apply damage for the ones that are close enough.

Your code will look something like this:

for ( TActorIterator<ACustomCharacter> it(GetWorld()); it; ++it )
 {
     float Distance = GetDistanceTo(*it);
 
     if (Distance <= DamageRadius)
     {
         UGameplayStatics::ApplyDamage(*it, DamageAmount, 
         GetInstigatorController(), this, UDamageType::StaticClass());
     }
 }

This should do it.

If you like to learn more about iterators in Unreal Engine 4, please go here:

Hope this helped!
Good luck!