Hi there,
We are using a simple pathfinding Line of Sight technique with a single line (Line of Sight Bar) that is directed towards the player at all times. If this bar is overlapping the player then the enemy can see you. Pretty simple.
The problem I'm having is that if we have two enemies on the screen, we have two Line of Sight Bars.
If the Line of Sight Bar is overlapping the Player, how do I choose the Enemy Object that is closest to the Line of Sight Bar's position?
Note, the Line of Sight Bar has it's X and Y at the bottom left so we can resize if it needed. So the X and Y of the Line of Sight Bar will always be overlapping the enemy it is attached to.