How to make actor detect closest player, and save it in variable? (function), please help.
- Find all actors of class
- For loop these and do:
- calculate distance (I believe this is a node) between the two actors
- Check if this distance is closer than the saved distance
- Save this distance AND the actor if closer
You’ll need:
- A distance (float) variable
- Prob an actor variable or whatever type you’re distancing to
Hello Zedory,
This was asked recently and there was a really nice blueprint graph that was given in a response. It’s basically what Evie Games described, where you overwrite the reference ONLY if the distance is closer.
(Image credit goes to BRGCooper)
1 Like
hi
is this resolved ?