Hello, I have a simple system in which an enemy is supposed to move into the player’s FOV before firing a projectile at them. I couldn’t find anything in the documentation that let me dynamically restrict what nodes to look for like that, so I ended up essentially using some vectors to create a kind of 3x3 squeezed grid in front of the player, and then plan to use RecastGraph’s GetNearest(position) to select a node within that grid for the enemy to path towards. I originally planned to use StartPath and a callback to check the nodes found at all 9 positions to see which one has the shortest path for the enemy to travel to, but then started wondering if using StartPath 9 times like that was actually super inefficient.
On top of that, before my enemy can move to a node, I also want to test that they’re even able to attack the player with a projectile from that position. My plan for that is to test the position with a capsule collider the same size as the enemy, and then use a spherecast from that to the player to detect whether a projectile would make it from that position to the player.
So my question is this: Is it more efficient to test all 9 found nodes with the projectile checker, and then find the shortest remaining ones with StartPath, or is it perfectly fine to use StartPath 9 times to build an ordered list of the closest nodes to the enemy, and then use the projectile test?