Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Navigation/Navmesh - Failed to create agent because it is not close enough to the Navmesh

Discussion in 'Documentation' started by phxtr, Oct 21, 2017.

  1. phxtr

    phxtr

    Joined:
    Jul 8, 2017
    Posts:
    1
    I had a working project, and made some customization and all of a sudden started getting the above error.

    I lost nearly a whole day troubleshooting this issue, rebaking the navmesh, redoing the agent settings, adding debug code, reading pages and pages of unity docs, as well as google results, etc. etc. Only to find out the error was 'expected'.

    I finally got lucky and found the solution in this thread here:
    https://forum.unity.com/threads/cas...nt-type-causes-failed-to-create-agent.485847/

    The 'problem' was that I had added a new agent type. The procedure/interface was just like adding a new type for everything else (tags, layers, etc), so I never realized additional steps were required to make a new agent type work.

    Nothing in the documentation stated that the standard Navmesh is ONLY for the 'Humanoid' agent, and that adding a new type requires extra procedures.

    Could you modify the Navigation pages to mention this fact? Somewhere in the more general sections that people are more likely to see, and not buried somewhere preferably, 8^).

    Would possibly save a lot of people a lot of headache and lost time troubleshooting something that could be avoided with a quick mention in the documentation.
     
    tuxkhan, Skyho, TobiasW and 4 others like this.
  2. trinistry

    trinistry

    Joined:
    Feb 2, 2014
    Posts:
    5
    The internet needs more heroes like you! Thank you for posting that here. There is no indication what so ever, why the agent would refuse to be on a NavMesh, when it is a custom agent type.
     
    Berillium and Frable like this.
  3. Frable

    Frable

    Joined:
    Nov 14, 2014
    Posts:
    1
    @phxtr Huge thank you from my side as well.
    Ran into the exact same issue and of course wasted lot of time to recheck various aspects.
    Never imagined that this might be the root cause for the problem.
    Changing to the default "humanoid" agent type made it work without a hitch.
     
    Berillium likes this.
  4. Meany747

    Meany747

    Joined:
    Jun 13, 2017
    Posts:
    7
    Massive thank you here as well, this is fairly poorly noted.
     
  5. GregoryFenn

    GregoryFenn

    Joined:
    Feb 13, 2018
    Posts:
    26
    I have the same problem and I'm using the only "Humaniod" agent :(
     
  6. God-at-play

    God-at-play

    Joined:
    Nov 3, 2006
    Posts:
    309
    Thanks! Frustrating lack of warnings in the editor for this
     
  7. tuxkhan

    tuxkhan

    Joined:
    Sep 4, 2018
    Posts:
    8
    I've got the same issue on Unity 2019.2.9f1, so I was struggling to understand this for hours.

    Thank you so much!!! I deleted the other two Agent Types, and having only Humanoid, and then the component started to work again.

    Again, massive thanks, there should be a special warning in the component if the Agents are not setup as @God-at-play posted.