Unity Navigation pathfinding

For characters to be able to dynamically pathfind their way around a scene, that scene needs to have a defined NavMesh - which marks the areas that can be traversed.

In 3D scenes, AC makes use of Unity's built-in Navigation workflow, and the NavMesh is baked from the scene geometry.

Upon creating a new 3D scene using the Scene Manager, the Pathfinding method will be set to Unity Navigation:


The other method for 3D scenes is Mesh Collider, which involves placing done a pre-made mesh - but the following is recommended for most situations.

For this method, we'll need to have the graphics already be part of the scene. Here, we've made some simple geometry using ProBuilder:

Begin by selecting all objects that you want to be included in the NavMesh calculation - this should include walls and stationary obstacles. From the top-right of their shared Inspectors, mark them as Navigation Static:

If you rely on Point and click movement to control your Player, you'll also need to place your floor objects on the NavMesh layer. This layer would have been created when AC was first imported.

Be sure to add colliders to your walls and floors, to prevent your characters from clipping through them.

When finished, open Unity's Navigation window from the top toolbar, under Window → AI → Navigation:

In this window's Bake tab, configure the Agent Radius and Agent Height values to suit your characters, and then click Bake to generate the NavMesh. It will appear in blue in the Scene window:

With the NavMesh baked, characters will then rely on it when commanded to move.