I’m making a tower defense type of game and decided to switch to A* because of the better grid-like movement that suits my game better. So obviously, I’m using the grid graph.
Now, this is where it gets a bit tricky. I want to be able to build my towers on the enemy path and they have to adapt around it. But what if the enemy path gets completely blocked? Right now, depending on the circumstances, it sometimes walks to a point along the path and sometimes it just gives up and walks to a certain point and falls through the map???
What I want is to reliably find a path to the closest object that is blocking the complete path. With Unity’s navmesh system that was fairly simple due to the pathStatus property which told me if the path was only partial (blocked). It then navigated to the closest path it could find anyways.
So the question is; how can I find the closest thing that is blocking the path and navigate to it? I’m using the free version 4.2.8 if that affects anything.