Hello, recently purchased your asset and it has greatly helped to simplify AI pathfinding for my current project, thanks.
I was curious if it was possible for my units using the GridShapeTraversalProvider to pathfind to the nearest possible node if the current target node is at an invalid position. For example, I am testing a unit with a square shape of 3 (3x3) using the default provided GridShapeTraversalProvider. The pathfinding works great for avoiding getting too close to walls as well as tight spaces, however when the player (The pathfinding target) moves along/bordering a wall tile, the AI is unable to construct a valid path. I have tried using path.calculatePartial in order to get the large unit to move to the nearest position however that did not work.
I have provided a video to better explain the situation.
https://drive.google.com/file/d/1-XS1rx8-atRNZRYtX15Qnnmv8Pa8sPNw/view?usp=sharing
Here is the current code I am using to calculate a targets path.
// Start pathfinding to target (This is on my custom character controller component)
public void StartPath(Vector3 position)
{
ABPath path = ABPath.Construct(transform.position, position, null);
path.calculatePartial = true;
path.traversalProvider = GridShapeTraversalProvider.SquareShape(_unitSize);
_seeker.StartPath(path, OnPathComplete);
}
I am receiving this error when the player is at an invalid position:
“The node closest to the end point could not be traversed”
As well as (Although much less frequent):
“The node closest to the start point could not be traveresed”
Note* I am using my own character controller implementation and not one of the built in AIPath components.
Note* I have tried increasing the max nearest node distance.