Static Path Calculation

Hi,
Is there any way to calculate the path between two nodes in a way the PathUtilities do?
I would need a method like
public static List<GraphNode> Path(GraphNode source, GraphNode destination)
At best without touching MonoBehaviour (Seeker, AStarPath, …) or Callbacks.

Thanks!

Regards
Chris

Hi

That’s not possible. You need to use the AstarPath class since that’s the object that actually calculates the paths.

This is the closest I can think of

var path = ABPath.Construct(start, end, null);
AstarPath.active.StartPath(path);
path.BlockUntilCalculated();
List<GraphNode> result = path.path;

Thank you very much! That’s what I’m looking for :slight_smile:

1 Like