Hi, I’ve encounter a strage behaviour.
I’m using a navmesh and applying this function to determine if a path is possible between two points; o (origin) and d (destination):
/// <summary>
/// Checks if a path between the given positions is possible
/// </summary>
public bool IsPathPossible(Vector3 o, Vector3 d)
{
GraphNode node1 = Navmesh.GetNearest(o, NNConstraint.None).node;
GraphNode node2 = Navmesh.GetNearest(d, NNConstraint.None).node;
return PathUtilities.IsPathPossible(node1, node2);
}
This always works at 60 FPS, however, when I cap the FPS lower, ex: 50, it returns true when it should return false.
The attached image represents a fail case, at 60 FPS the function determines that the path is not possible, however, when the game runs at lower framerates, it determines that the path is possible.
I’ve tried setting the maxNearestNodeDistance
field to zero, however it doesn’t fix the issue.
I’ll attach all the info I have:
My A* version is 4.2.18 and the Pathfinder component Inspector settings are the following ones:
O point position: X: -6.87 Y: -7.75 Z:0
D point position: X: -7.14 Y: -7.32 Z:0
I’ve uploaded the mesh (example_mesh_asset.asset) as an unity .asset file here.
Am I doing something wrong?
Thanks in advance,
Julen.