Raycast Modifier with linkgraph issue

  • A* version: 5.4.6
  • Unity version: 6000.2.13f1

I’m using the Raycast modifier on a recast graph, which I know isn’t super recommended. The modifier uses graph raycasting, and not physics. If you add a nodelink2 at runtime, you also get a linkgraph. Then when the raycast modifier is attempting to validate the start and end of the path, it fails to validate the end - v2, and thus fails to find n2. This makes the final path a straight line. This can be fixed by resetting the NearestNodeConstraint after using GetNearest() to find n1, as it is passed by ref - this is assumedly because during the finding of n1, we check the closest point on the recast graph, then we check the linkgraph. This second check then changes the byref constraint such that when checking the recast graph for v2, it fails.