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:

If you rely on Point and click movement to control your Player, you'll 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 a colliders to your floors, to prevent your characters from falling through it. If your game uses Direct movement, add colliders to the walls as well.

The final step is to bake the NavMesh. How to do this depends on your Unity version, because 2022.2 and beyond uses Unity's new AI Navigation package.

Unity 2022.2 and later

You will first need the AI Navigaton package to be installed, if it isn't already. To do this, choose Window -> Package Manager in the top toolbar, and import Unity's AI Navigation package.

Next, select the floor GameObject in the scene, and add the NavMesh Surface component. Configure the component to suit your game's needs - further details on this process can be found here - and then click Bake in its Inspector. It will appear in blue in the Scene window:

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

Unity 2022.1 and earlier

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:

Next, 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.