Search Unity

Setting Walkable areas on the Terrain

Discussion in 'World Building' started by zedz, Oct 26, 2021.

  1. zedz

    zedz

    Joined:
    Aug 31, 2013
    Posts:
    250
    A suggestion for something to add to Unity.

    At the moment what I do with my terrain is have 2 copies of it.
    1. the standard terrain, the one thats get drawn, collided against etc
    2. a copy of this terrain but painted with holes, showing the ares where you can not walk
    So when I generate the navmesh I disable the standard terrain and use the holy terrain to generate the navmesh (and as a bonus, navmesh generates quicker) this gets disabled when I'm playing the game, i.e. its only for navmesh generation

    This works great until, I want to change the terrains heights somewhere, then both terrains are out of sync.
    Best solution would just to have the single terrain and just the ability to paint a navmesh walkable (or the opposite, not walkable) on the terrain

    Possible?
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,432
    The ability to "paint" a texture on a terrain, then build a navmesh from the painted areas, is a question that pops up about once a year. There's finally a tool that works with navmeshes here: https://assetstore.unity.com/packages/tools/ai/navmesh-generator-174673 but I have not used it so cannot tell you if it's good. The price is reasonable to give it a try.
     
    zedz likes this.
  3. zedz

    zedz

    Joined:
    Aug 31, 2013
    Posts:
    250
    OK thanks I will prolly grab that then. It looks a bit of a roundabout way to do it, creating extra terrains and then destroying them, afterwards. It would be so much easier if they just added another splat alpha texture to the terrain (which you could choose either to display as an overlay over the terrain), its what they do already now with the holes I assume with the Terrain.asset
     
    Ony likes this.
  4. zedz

    zedz

    Joined:
    Aug 31, 2013
    Posts:
    250
    OK it seems as if that tool has an error with larger terrains, mine was 1km x 1km ~1m per vertex
    Out of bounds errors, I could get it working if I lowered the detail but then it looked terrible, and judging by the ratio even at maximum (if it didnt crash) it would still look pretty bad.

    I think I will just have to do what Im currently doing, 2 meshes and paint holes in the one