What is the best way to deal with this? To clarify, I want enemies to find a path to the closest walkable grid point near the player when the player is too near a wall to be within a walkable area due to a fairly low-res grid… but not if the closest point is otherwise a bad idea (eg on the other side of the wall), or too far away (i.e. in case the player actually is currently unreachable and not just “near” a wall).
That is to say, the player is within a walkable area, but it is technically unwalkable only because the nearest grid point is near enough to a wall to be considered unwalkable by the grid scanner. I don’t have any other need for a higher-resolution grid graph, so don’t want to compromise my performance by doing that. I would rather find some way to get the correct nearest walkable node as described… but simply finding the nearest walkable node is not enough, because it could be the wrong point.
Tricky.
There is a setting in A* Inspector -> Settings -> Max Nearest Node Distance which you can use to specify an upper limit on how far away a node should be able to be to be “close enough”. Can’t really help much more since “other side of a wall” is something the pathfinding system doesn’t know about…