How to loop through tagged actors in sphere to collision to find and face the nearest one.

Using Blueprints, I’m looking to get the location of all actors with a specific tag that are overlapping a sphere I have on the player character so that I can rotate the player towards the nearest actor when the player starts attacking. I’ve gotten this far, but am unsure how to actually get the location of each actor in the array from here.

Why do you filter the tag twice?
They are node call " Get Distance To" , Compare if the distance is less than previous actor of the array

Yeah, short answer is I had no idea what the sequencing should have been. After doing a bit of research and testing I actually ended up getting most of what I was looking for with this setup so far:

The main thing I need to solve next is how to get only the “nearest” actor that is valid and head towards them. So I’ll try your suggestion for “Get Distance To”. Thanks!

Maybe a real programmer can give you something better, my dyslexia makes me always mess with the “>” “<” operators but this should work,

Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.