NavmeshCut with the isDual option enabled sometimes produces unexpected results

  • A* version: 5.3.8
  • Unity version: 6000.0.41f1

Hello, I’m using a NavmeshCut on tiled recast graph with the isDual option enabled to define a specific region where I apply a custom tag. The issue I’m encountering is that sometimes, particularly along tile borders, one or more inner triangles within the cut’s shape get merged with external ones, which interferes with my intended use. To illustrate the issue, I placed a box-shaped NavmeshCut directly between adjacent tiles and assigned a different tag to all surrounding nodes using a custom GraphUpdateObject:


The green and grey triangles are being merged with triangles outside the cut area.

I traced the issue to the DelaunayRefinement function in TileHandler.cs. It appears to merge adjacent triangles that share a colinear edge indiscriminately. Forcing the colinear variable to false resolves the issue in my case:


There’s likely a better solution that doesn’t require ditching the triangle merging optimization (e.g. maybe something like post-processing inner and outer triangles separately, I don’t know :slightly_smiling_face:).

Interesting find, thanks for reporting it. May be something Aron will want to look at for future updates so I’ll tag him on this :+1:

1 Like