A* Pathfinding Project
4.1.23
The A* Pathfinding Project for Unity 3D
|
Detailed explanations of various error messages that you may see when using the package.
These are errors that you may get when searching for paths. None of these errors are fatal in any way, it just means that the system couldn't find a valid path for some reason.
When a path request is started it will query the pathfinding system for the closest node (a node is one tile in a grid graph, one triangle in a navmesh/recast graph and one point in a PointGraph) to the start point of the path. This search has a limited range, though usually it is more than enough for all practical purposes. So if you try to request a path starting from some point that is nowhere near any (walkable) nodes on any graph then this error will be logged.
Ways to resolve this error:
This is very similar to the error above. However when searching for the closest end node to the end point the system has an additional constraint in that the node must not only be walkable, it must also be able to be reached from the starting node. A common case when this error shows up is if the AI is say locked in a small room on one end of the map and gets an order to move to a point very far away. When trying to find a node close to the end point it will have to search a very large distance since only the nodes inside that small room are reachable from the starting node.
Ways to resolve this error:
This should not trigger unless you have supplied a custom NNConstraint on the path object that does not inherit from PathNNConstraint or that does not use the logic from the PathNNConstraint class.
Ways to resolve this error:
This means that there is no possible path from the start node to the end node. Usually this happens if you are using tags and are configuring them so that some tags cannot be traversed. With regular walkability, the system precalculates which nodes of the graph can be reached from which other nodes, however with tags it is not possible to do this.
This image shows the nodes that were searched when all tags could be traversed. Note that all nodes inside the red rectangle have a modified tag.
This image shows the nodes that were searched when the nodes inside the red rectangle could not be traversed due to their changed tag. Note that every single node that could be reached from the start node had to be traversed in order for the system to come to this conclusion.
This error is just a special case of the previous error. It is logged when only a single node was searched in the path and the end of the path could not be found. This particular error often happens due to a simple configuration error of grid graphs. If the AI has a collider and that collider is included in the Height Testing layer mask in the graph settings, then it may happen that the graph places a node on top of the AI's head (see image).
The result is that the AI thinks it is locked inside a very tiny room and cannot get out from there.
Ways to resolve this error:
The Seeker component only handles a single path request at a time. Since path requests are asynchronous it may happen that a script tries to start to calculate a path before the previous path has been fully calculated. There are several times when this is reasonable, for example the agent might have teleported to another part of the map, then any previous path calculations would be pretty useless. In any case, when this happens the Seeker will cancel the previous path request and set this error message as the reason for it failing.
If you are seeing this message even when you are just trying to calculate paths normally it may be because your script is not properly waiting for the previous path to be calculated before starting a new path calculation. You can check if the Seeker is done calculating by calling the Seeker.IsDone method, or you could simply wait until the OnPathComplete callback is called.
This is very similar to the previous error message, but it means some script cancaled the path request using the Seeker.CancelCurrentPathRequest method. As the path was canceled explicitly by a script, one can reasonably assume that the script knows what it is doing, so you likely do not need to worry if you see this message.
The AstarPath component does not contain any graphs at all. If you are loading graphs from a file or creating a graph using a script, it seems that some other script is trying to request a path before that has been done.
Unity's static batching system is great because it can combine multiple drawcalls into a single drawcall to improve the performance of your game. Unfortunately in doing this Unity also makes it impossible for this package's scripts to read the mesh data during runtime (except in the Unity editor). For recast graphs this means that those meshes cannot be used to generate a graph during runtime.
This image shows the toggle that Unity uses for static batching.
Ways to resolve this error:
If the package did not install or upgrade correctly you may see some compiler errors. If you have just upgraded the package, the easiest way to make sure UnityPackages have not messed something up is to delete the AstarPathfindingProject folder (and the AstarPathfindingEditor folder too if you have it) and then import the package again.
Otherwise I recommend searching the forum for threads that mention similar errors.