How do I set up Navmeshes for characters of different sizes?

Is there a way to have some areas inaccessible by characters that larger than smaller characters? I realise that a large character won’t be able to got into the narrow area but is it smart enough not to even try?

Alternatively is there a way to have multiple nav meshes for different sized characters and then a way to specify which navmesh to use when performing pathfinding?

Or perhaps a way to increase the cost of areas of the navmesh for characters of different sizes?

The basic way we support different sized navigation actors is to have a separate navmesh per agent size. The reason is that Recast pre-bakes agent size into the navmesh structure for efficient pathfinding.

You can configure navigation system’s supported agents in Project Settings > Navigation System > Supported Agents

Different-sized agents support on a single navmesh is in out backlog, but it’s not going to be done soon.

–mieszko

Do you have any tutorial on this?
I did add different agent settings and created multiple NavmeshBounds but how will the system know which ai is the “supported agent”? There is no option in character settings to add the supported agent name.
I have 2 types of ai, parkour and non-parkour. I dont want the non-parkour to use nav link proxy

I have a same issue ! Any Advice ?

The Nav Agent System doesn’t work the way you would expect it to, and you can’t specify which Agent AI characters use. The best workaround I’ve found is the following:

  1. Right-click in your content browser and create a new blueprint actor of “NavArea” type. Give it a descriptive name for the AI you want to use it like “NPC_XYZ_Area”

  2. Create another BP actor - search for “Nav Filter” in the class search and select “NavFilter_AIControllerDefault”. Give it a descriptive name like “NPC_XYZ_NavFilter”. Open this and add a new array element by clicking on the +. For the AreaClass give it your custom AreaClass you created in step 1. FYI it might not show in the list, but if you select it in the Content Browser and use the Arrow to force it in, it will work.

  3. Open the AIController for your NPC and search for “Nav” in the class defaults. Under Default Navigation Filter Class specify your NavFilter you created in Step 2.

  4. In your level, add a Nav Modifier volume (or several), set it to whatever size you want to make sure that your NPC will fit in the area you place it (IE make it narrow if you want your AI to avoid walking into walls, buildings etc.), and then set its Area Class to match the area class you created in step 1.

  5. Watch as your AI moves only on these volumes and forget about the stupid Navigation Agents system that we can’t control.

1 Like