I am completely stumped. All I want is to be able to use a targeting system like unto Kingdom Hearts, where the game automatically picks the nearest target (provided that they are in a predetermined range) so that when the attack command is selected the player sprite will "dash" to coordinates adjacent to the targeted enemy and perform an attack. This is what I have tried so far.
I have created an ATKRadius circle object. I test for whether the ATKRadius object is overlapping any of the objects in the Enemies family. If it's true, then I want the player to move to and attack the nearest enemy. My event looks like this.
Although in debug mode I can tell that it does select the nearest instance, when I call the moveto command, it will always send me to the Enemy whose UID is lower. No matter where I am on the map.
I thought I could be clever and have a turret do this work for me, selecting nearest opponents and what not, but doggone it there is no way (as far as I can tell) to return the coordinates for the target the turret acquired. (For that matter, I can't get C2 to return anything about the target, despite documentation that an expression for TargetUID exists.)
How should I do this?