What is the best way of doing a radius foreach loop in blueprint?

Hi I’d like to check for pawns with in radius of an actor in blueprint, whats the best way of doing this now?

All the best

greg

Hi Showster,

You can use the ‘get all actors of class’ node to get an array of objects you want, and feed that into a for each loop. From there, use the ‘get path length’ node, giving the path start and end values as the locations of the central actor and the pawn to be checked, and compare that length to your radius.

Here’s what the blueprint would look like:

Additionally, you can do a sphere trace for objects if you are not worried about getting things above or below you.