Hello, I would like to report what I believe to be a bug that affects exporting a recast graph into a navmesh graph on version 4.2.2 of the library.
Problem Description
Exporting a recast graph and then importing it as a navmesh without modifying it can result in cross-tile nodes failing to connect on the navmesh.
The recast graph:
The generated navmesh once imported:
How to Recreate
- Import version 4.2.2 of the A* Pathfinding Project.
- Open scene
Assets/AstarPathfindingProject/ExampleScenes/Example3_Recast_Navmesh1/RecastExample
- Under the
Astar Path
component, changeTile Size
to50
and scan. - Export the RecastGraph to
Resources/navmesh.obj
- Under the
Astar Path
component, create a new Navmesh Graph and connect the generated navmesh. - Disable or delete the original recast graph.
- Observe the missing connections around nodes near tile boundaries at obstacles.
Speculation
This seems to be due to using tiles in the recast graph when generating the navmesh. From viewing the mesh in Blender, it’s exported with each of its tiles having no shared vertices. It seems that normally this is resolved in the NavMeshGraph
without problem by merging any shared vertices in the mesh. However, using RecastGraph
it is possible to generate graphs where triangles on the border of tiles have adjacent edges without sharing two vertices.
I’ll attach an image below (if possible) to try to provide a visual aid to explain what I mean (new users are limited to 2 images per post).