My character exists in a 3D, isometric, top-down world.
I'd like to make an aim assist mechanic, such that when holding the right joystick in a direction the game will choose the enemy roughly in that direction from from the character.
i.e. when holding the stick left, an enemy to the left of them on the screen is chosen, even if that enemy is above them on a cliff in gamespace.
The issue that's confusing me is searching through enemies in screen-space.
My best idea for a solution would be to transform all targetable objects into screen space when the stick is held, compute the "distance from line" of all of them, sort, and choose the smallest (where the line is a line drawn from the character's screen coordinates in the direction of choice).
Can anyone think of a cheaper way to do this? Maybe a hack where I could take advantage of isometrics? I may have hundreds of targetable objects on screen at once and I'd to be able to do this every frame.