- A* version: 5.3.3
- Unity version: 2022.3.52f1
I’m working on a few different things for offline path generation, and generating off-mesh links for organic terrain.
With this code, I get very different results at edit time and at runtime. My editor-time paths will stop short from the destination and go to the center of the node. Modifiers also don’t get applied (trying both Funnel and Smooth).
Am I missing a setting, or doing something strange?
Here’s my code:
var path = ABPath.Construct(transform.position, nearestPoint, (Path p) =>
{
seeker.PostProcess(p);
});
path.nnConstraint = NNConstraint.Walkable;
AstarPath.StartPath(path);
path.BlockUntilCalculated();
Here’s the settings of the Seeker:
This is the path at Edit time, generated from the above code (red gizmo trail):
And here’s the same path at runtime.
This is tangential, but for context, the blue gizmos are what I’m actually trying to do, which is calculate “shortcuts” to places that can be in the same graph area. It detects if the point is jumpable, and compares the jump distance with the path distance (using the same pathfinding code as above). It then discounts points that are faster to walk to, with some multiplier. You can see in the edit-time screenshot it finds a bunch of points nearby, because the pathfinding results are so jagged, it thinks it would be faster to jump there.