Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted How to generate NavMesh with different area costs from terrain?

Discussion in 'Navigation' started by Peter77, Oct 20, 2020.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    5,468
    I have an Unity terrain where I painted several paths. I want these paths to have a different area cost than other parts of the terrain.

    How can I do this?
     
  2. Hannibal_Leo

    Hannibal_Leo

    Joined:
    Nov 5, 2012
    Posts:
    235
    If they are painted, you can't - you need Meshes because the NavMesh only cares about Meshes (and Colliders) and not about textures.
    You can create a Mesh along your path (or build it with cubes, they won't be visible in the game and won't collide with anything) and set the Surface Type to something like "easy to walk" instead of the usual "walkable" - then reduce the area cost. Bake. Done.
     
unityunity