Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Navmesh painting areas ....

Discussion in 'Navigation' started by Zace666, Feb 10, 2019.

  1. Zace666

    Zace666

    Joined:
    Jan 28, 2014
    Posts:
    19
    I am trying to set up a terrain whereby my lil minions with use their AI to journey along roads and paths, rather than taking a beeline straight over a mountain.
    Looking in the Navigation window and the Areas tab I see that I can set colours to area and the associate a cost to them -this is great - EXCEPT how do i assign the colours to various areas of terrain? Can I paint the hillsides in a certain colour associated with hills and a movement cost of 2.5, sidewalks as another colour and a movement cost of 0.75 to hopefully get them to walk alongside a road?
     
  2. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    153
    Unfortunately it's not that simple to assign different NavMeshCosts per surface out of the box.
    If you take a look at the NavMeshComponents package, you'll see that there are NavMeshModifierVolumes.
    Your best approach would be to place these volumes on hill slopes and such to set this up properly.
    This is possibly a lot of manual work, so if you think it'd be more efficient to write an editor script for this, you'll probably want to use the Terrain's height map to scan for the right differences and create Modifiers accordingly.