Hello,
You can use Actor Iterator to find specified Actors in defined range:
float MaximumDistance = 100;
for (TObjectIterator<AActor> Itr; Itr; ++Itr)
{
float Distance = GetDistanceTo(*Itr);
if (Distance < MaximumDistance)
{
GEngine->AddOnScreenDebugMessage(-1, 3, FColor::Cyan, Itr->GetName());
}
}
If you like to learn more about Object and Actor iterators, please go here:
Hope this helped!
Cheers!