Connecting RecastNavmesh to RecastMeshObj

Hello there, I’m currently using the 5.03 Pro version of this asset and it’s been great so far.
I have a road network and for its sidewalks and crosswalks I generate a RecastMeshObj during import. I’m currently trying to add a new recast mesh in a particular area but I’m having trouble connecting the two meshes. I think the pictures would do a better job at explaining the problem. The behavior I’m expecting is for the path to go trough the additional navmesh as it represents a shorter path however it seems that there is something wrong with the connections.
Is what I’m trying to do possible? If so, could someone please tell me what I’m doing wrong? For reference I’ve tried both recast and grid mesh for the additional area but I have the same result. For the additional nav mesh, it’s layer mask is set to everything.




So reading your post and looking at this image, is this not the desired outcome, them taking crosswalk at the intersection? Or is the big square your RecastMeshObj? (Mine doesn’t have a box inside it like yours, but I also didn’t try to make it have that, as mine worked well as is, so I’m just double checking I’m looking at the right thing.)

As for your units, which script are you using, if you’re using one of the built in ones? Can you send a screenshot of them as well?

Yeah, so the big square is the extra RecastMeshObj. So ideally, I would like to reach the target by going trought the square which is a shorter distance than using the crosswalk. Additionally, if I start from inside the cube, a path will be found to the edge of the cube closest to the target. After a while the system figures out the path form the edge to the target itself which makes me think that the nav meshes are connected.




Hmmm, yeah I’ve spent some time on this one and I’m having a hard time understanding the relationship between a graph with a gap in it and how RecastMeshObj (now called RecastNavmeshModifier now btw! Update just dropped.) interacts with it.

I’m wondering if this is a situation more fit for NavmeshAdd? @aron_granberg you have any insight on this one?

As an experiment I created the following scene seen in the sceenshot bellow.
I used two plane objects and set their layer to “Sidewalk”. I configure one recast mesh to only Rasterize Colliders and work only on the “Sidewalk” layer. I also created a bridging navmesh that rasterisez meshes on every layer.
I switched over to Follower Entity Script and attached the AI Destination Setter as well.
Unfortunately, it is still not able to find a path between the two sidewalks. For that experiment no RecastMeshObj components were used, just layers.

After spending a bit more time researching this topic it looks like it’s really not recommended to have more than one Graph as connecting them is tricky and furthermore, agents can get confused when trying to follow a path. For now I solved the problem by using a Plane object, disabling it’s rendererer and putting it in a layer that I want my main Recast graph to rasterize. This produces the desired result.


I’m still curious to know about issues involving multiple graphs interacting together.

Ah, you are using two graphs. I did not realize this earlier.
Different recast graphs will not automatically connect to each other. You need to manually connect them using off-mesh links (see OffMeshLinks - A* Pathfinding Project).

The way you have solved it in your last post is what I would recommend.