Support Forum

Cost and length

Is there a way to get the cost and length of a path?
I tried using ConstantPath.CalculateHScore(GraphNode node) and Path.GetTotalLength(), but both return 0. The paths are valid, though. My agents can navigate them just fine.

I found it out myself.
I was using a ConstantPath, but I needed to use an ABPath, which I got by using Seeker.StartPath(constantPath, onComplete). Then, the first argument in the onComplete delegate is an ABPath, which has a VectorPath with items in it and therefore has a cost and a length.
I hope this helps someone in the future.

1 Like