Use influence or threat maps with navmesh

Howdy. I’m using the built-in Unity Navmesh for many agents to traverse a flat plane with dense number of layers.

Sometimes I want my agents to path to a location by moving through FRIENDLY territory only

To do this I likely need an influence or threat map that can updated during runtime which will change pathing costs and behaviour on SPECIFIC portions of the navmesh for CERTAIN agent types.

You can change the navmesh’s default layer costs per agent and during runtime, but I need to be able to change threat/influence maps that affect specific portions of the mesh, and will change the pathing costs of CERTAIN agents.

Does anyone know of a way to use unity navmesh with influence or threat maps?


Hello,
To dynamically modify Navmesh costs for specific agents, consider these techniques:

  • Off-mesh links: Create temporary paths around obstacles or threats.
  • Navmesh baking: Regenerate the Navmesh with updated costs. AARP Mahjongg
  • Custom pathfinding: Implement a solution for complex scenarios.

Balance performance and accuracy when choosing the best method.

Thanks for the reply. Unfortunately navmesh baking won’t help - it needs to affect CERTAIN portions or the mesh, not just entire layers.