So, I have an AI that pathfinds towards another AI and attacks them.
The hunted AI is spotted by the hunting AI it sets an instance variable called PursuitDetection to one on the hunting AI. Every 0.5 seconds PursuitDetection is equal to one, it is supposed to find and move along a path towards that specific hunted AI that was detected. The problem is that the pathfinding selects a random hunted AI on the whole layout.
Is it possible to, when setting a target for the pathfinding, to select the closest 'hunted AI'.X and 'hunted AI'.Y to the hunting AI?