Hi
Before moving to A* I was using Unity Navmesh. Using Navmesh I was able to visualise the path to the player using the NavMeshPath type which converted nicely to a series of line positions.
Is there a similar way to visualise the A* path for an agent? Ideally a way I can get the path as a series of vector3s or as a NavMeshPath which I can then pass to my existing functions?
This is what I was using
void DrawPath(NavMeshPath path)
{
line.positionCount=path.corners.Length; //set the array of positions to the amount of corners
for (int i = 0; i < path.corners.Length; i++)
{
line.SetPosition(i, path.corners[i]);
}
}
Called using….
DrawPath(agent.path);
Olly