- A* version: 5.3.8
- Unity version: 6000.0.46f1
Im using Follower entity and recast graph.
Trying to calculate a path for display purposes, but the results are neither the shortest path nor the path that the FollowerEntity would follow if it were moving in that direction.
this is what im doing:
public void CalculatePath()
{
Vector3 startPosition = _characterController.position;
NNInfo startNN = AstarPath.active.GetNearest(startPosition);
NNInfo endNN = AstarPath.active.GetNearest(this.targetPosition);
ABPath path = ABPath.Construct(startNN.position, endNN.position, OnPathComplete);
AstarPath.StartPath(path);
}
private void OnPathComplete(Path p)
{
if (p.error)
{
Debug.LogError("PathFindingFailed");
ClearDots();
return;
}
List<Vector3> pathPoints = p.vectorPath;
DrawDottedPath(pathPoints);
}