Try sorting the array of enemies by their location before running the loop.
For instance, if you want to move right, sort the array so that the right-most enemies were the first in the array, and the left-most — the last.
However, it might be tricky to do in blueprints. In C++ it is possible to sort an array depending on a certain value, but blueprints don’t give you such an option, unfortunately, so you might have to write a custom sorting function.
1 Like