Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Why is the navmesh based on mesh renderers and not colliders?

Discussion in 'Editor & General Support' started by TwiiK, Sep 22, 2014.

  1. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,730
    This seems so counter intuitive. I've spent so much time setting up proper colliders for my scene, but when I bake the navmesh it looks like S*** becaus it ignores them completely.

    And that must be extremely expensive? Taking every nook and cranny in my meshes into account when generating the navmesh instead of just using the simple colliders I thought I had set up for that purpose.
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I was in the same boat. Best you can do is make an asset that will generate boxes from box colliders (assuming that's what you used) and then run navmesh on that.

    It is silly, yeah that you can't just use colliders in the bake since in most cases you want collisions anyway for everything else. Don't think this feature was thought through tbh.
     
    Wolfos likes this.
  3. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,730
    Thanks for the reply.

    I figured out I can put meshes on my colliders and then just hide them after the generation is done.

    But seems a bit silly, and hacky. I'm fiddling about with the Nightmares tutorial for Unity 4.6 and it doesn't feel like the navmesh system was made for this sort of thing. Perhaps it works better with terrains and such.

    The only thing I want to be walkable is 1 quad which serves as my floor and then my colliders should block off sections of that quad. I'm nearing that point now, but it wasn't easy. :p
     
  4. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,730
    Hmm, it also seems to "break" when you have just 1 quad as you floor. The navmesh tears in places for seemingly no reason. Not sure why. Perhaps because it ends up being the most horrible ngons ever seen by man? :p