Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Unable to Bake a NavMesh

Discussion in 'Editor & General Support' started by tjjos, Oct 16, 2012.

  1. tjjos

    tjjos

    Joined:
    Aug 24, 2012
    Posts:
    3
    Hi all,

    I'm trying to bake navigation info onto a simple mesh following the instructions outlined here. The mesh is marked as navigation static. I then go to the Navigation Window and click on the Bake button, but nothing happens. If I go to the scene, I find a file called NavMesh.asset with some data related to the navigation, but the mesh is not colored blue (as it usually is when navigation is successfully baked). If I create an Agent with this NavMesh, when I press play I get an error indicating the NavMesh is not valid.

    I've tried several combinations and approaches but I always get the same result. What am I doing wrong? Can someone please help me? I've been stuck with this for a couple of days and it's driving me crazy :x

    Thanks in advance,

    Jos

    P.S. It's worth noting that nothing is displayed on the Editor and no log entry is generated when I click the bake button. It only creates the NavMesh.asset with (apparently) invalid data.
     
    Hincuu likes this.
  2. foxter888

    foxter888

    Joined:
    May 3, 2010
    Posts:
    530
    is your unity the pro version?
     
  3. tjjos

    tjjos

    Joined:
    Aug 24, 2012
    Posts:
    3
    Yes, we have Unity Pro.

    The main problem is that the NavMesh baking tool is fairly inconsistent. Sometimes it works, then you change the most minimal thing (like moving a vertex) and the baking doesn't work anymore.

    The thing that bothers me the most is that I don't get any feedback whatsoever about what am I doing wrong.

    Any ideas?
     
  4. runner

    runner

    Joined:
    Jul 10, 2010
    Posts:
    865
    having trouble?

    create a separate layer
    assign mesh's to this layer

    in the inspector check to make sure the mesh [objects] are assigned and the layer is also the correct one.

    Bake!

    after this is done baking you should see a nice blue mesh, but if you don't assign the layer to the main camera you wont visually see it otherwise.

    Note: normally i believe Navmesh bakes to the default layer so you should have seen the blue navmesh
     
    Last edited: Oct 17, 2012
  5. CreativeChris

    CreativeChris

    Unity Technologies

    Joined:
    Jun 7, 2010
    Posts:
    364
    Hi @tjjos,

    "but the mesh is not colored blue" - What colour is it?

    In relation to an invalid Nav Mesh error, can you post some screenshots so we can see after the bake and also see the nav mesh layer /s? if the agent doesn't match that layer it cannot attach to it.

    Thanks,
    Chris
     
  6. tjjos

    tjjos

    Joined:
    Aug 24, 2012
    Posts:
    3
    First of all, thanks for answering guys.

    After some more experimentation, I found out what the problem was (and it's not related to the layers, but thanks for the suggestion either way):

    I turns out that my model (imported from FBX file) was too small, because by default unity scales them by 0.01. So when I wanted to bake a NavMesh using this model, the process was working correctly (supposedly), but (and it's a big but - no pun intended), doesn't show the blue mesh because it was basically infinitesimal (to small to see). To explain a little bit further, the default (an even the minimum) values permitted by the baking were many times greater than the actual model dimensions, so when the baking process tried to calculate where the NavMesh would go, there was not "enough room" for it to fit the most minimal unit of a NavMesh. Make sense?

    So, to fix this issue, I just scaled my model until the baking process was able to calculate enough data for it to show the "long sought" blue mesh of success :p

    Either way, it would be nice if Unity would issue a warning like "Unable to bake mesh because it is too small!!!", or something like that so that you would not have to spend days trying to figure out what was wrong using your 6th sense, or spider sense or experienced-programmer sense, or whatever sense you might have developed for this kinds of situations.

    Anyways, thanks again for your help.

    Jos
     
    Hincuu likes this.
  7. orphicsage

    orphicsage

    Joined:
    Jul 10, 2013
    Posts:
    5
    Although re-sizing the model via the import settings works. Simply adjust the radius in the bake settings. That should fix the problem :)
     
    Amal-Sh likes this.
  8. diggerjohn

    diggerjohn

    Joined:
    Apr 28, 2009
    Posts:
    36
    I wrestled all morning with this only to have the same problem. No warnings, no indication of what the problem was.
    Thank you so much for this post.
     
  9. Bitpocketer

    Bitpocketer

    Joined:
    Jul 20, 2014
    Posts:
    4
    Damn , i had been stuck with this problem for past few hours untill i came across this post. Thanks it worked, but what i'm trying to achieve is animate the light through navemesh , say like i have an octupus , and the light has to illuminate all its legs being navemesh agent, and the octupus is small in size. what would be the good approach to do this?
     
  10. Whiteleaf

    Whiteleaf

    Joined:
    Jul 1, 2014
    Posts:
    728
    Sorry for reviving a dead thread, but I came across this as I was having issues with the navmesh baking.

    For me, all of my object's scale was: 1, 1, 1. and in the NavMesh baking options, the height was set to 2, thus leading to it not baking as it couldn't. Hope this helps someone.
     
  11. LukeLitman

    LukeLitman

    Joined:
    Jun 9, 2015
    Posts:
    4
    Ran into a similar issue, I had forgotten to mark the meshes as static... Hope that helps.
     
  12. unity_2eEU0X07EyPyDQ

    unity_2eEU0X07EyPyDQ

    Joined:
    Aug 5, 2018
    Posts:
    1
    This was my issue! Thanks!
     
  13. CompediaDev

    CompediaDev

    Joined:
    Nov 18, 2014
    Posts:
    3
    Just throwing out here that I had about the same issue, and mine was solved by setting the Min Region Area in the advanced baking settings to a lower value, since the areas I was trying to bake were very small.
     
  14. QuietTension

    QuietTension

    Joined:
    Sep 23, 2019
    Posts:
    1
    I get the issue and didn't work any of above answers, and figure out the solution is unbelievably stupid. If you baked while turned off the Gizoms, you will not see the blue area, so just turn on the Gizmos. God I'm feel so stupid now lol :).
    Screenshot (234)_LI.jpg
     
    winryese likes this.
  15. darklord849

    darklord849

    Joined:
    Jan 11, 2018
    Posts:
    3
    Thanks a ton, if I would have read this before doing this by myself , i might xD