You can augment the NavMesh that you create for your terrains by adding custom NavGraphs. Often, the placement of these NavGraphs is implicit in the design of the game level. In this case, the NavGraphs can be created during the NavData generation process, typically in a post-processing phase that you carry out after generating the NavMesh for the level. However, you can also create and spawn the NavGraph dynamically at runtime. For example, you might need to use this approach if you want the NPCs in your game to be able to use ladders that can be moved to arbitrary places.
You can craft a NavGraph using a NavGraphBlobBuilder object, as follows:
Note that you can add multiple NavGraphs to the same NavData object. However, you cannot add NavGraphs to a NavData object that already contains a NavMesh, or to a NavData object that has already been added to a Database.
If you are creating your NavGraph as part of your data generation process, you should package up your new NavData object the same way you do for the NavData objects created automatically by the data generation system.
If you are creating your NavGraph dynamically at runtime, you can simply add your NavData object to the Database the same way you do for the NavData objects that contain your pre-generated data.
Call either NavData::AddToDatabaseImmediate() or NavData::AddToDatabaseAsync().
For a code example that shows how to create a NavGraph during a post-processing phase of the data generation process, see the Tutorial_Generation_postProcess.cpp file.
For a code example that shows how to create and add a NavGraph on the fly, see the Tutorial_NavTag.cpp file.