There's more...

The aforementioned process is definitely not performance friendly, and works best in cases where we don't know for sure the topology, such as in procedural-generated levels. Although we put in place the example with a known level, we can rely on prefabs and programming to recreate most of the previous steps and apply them in a procedural-generated level.

On the other hand, if we know for sure the level's layout and want to improve performance, we could leave the Carve option unchecked in the Nav Mesh Obstacle component, and play with the obstacle avoidance parameters (found in the Nav Mesh Agent component) until we get a result that satisfies our needs.

Finally, we could just play around with a mixed method to find a balance ...

Get Unity 2018 Artificial Intelligence Cookbook - Second 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.