Off Mesh Links

Sometimes, there may be some gaps in the scene that can make the navigation meshes disconnected. For example, our agents will not be able to find the path if our slopes are not connected to the walls in our previous examples. Or, we could have set up points where our agents could jump off the wall and onto the plane below. Unity has a feature called Off Mesh Links to connect such gaps. Off Mesh Links can either be set up manually or generated automatically by Unity's NavMesh generator.

Here's the example scene that we're going to build in this example. As you can see, there's a small gap between the two planes. Let's see how connect these two planes using Off Mesh Links:

Scene with off mesh links-NavMesh04-OffMeshLinks.scene ...

Get Unity Artificial Intelligence Programming - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.