Search Issue Tracker

Active

Votes

10

Found in

2017.2.0b4

Issue ID

936460

Regression

No

Custom NavMesh Agent Type causes an error "Failed to create agent" in the Console

AI

-

Reproduction steps:
1. Open the attached project "BugReport_NavMesh_FailedToCreateAgent.zip";
2. Open Scene.unity;
3. Select "My Agent" in Hierarchy and notice its "Agent Type" is "Humanoid";
4. Bake the navmesh and enter a play mode;
5. Click somewhere on the screen - observe the agent moves around;
6. Stop the play mode and change "Agent Type" to "Robot";
7. Press play and click somewhere on the screen.

Actual results: The agent does not move but outputs an to the Console window:
"Failed to create agent because it is not close enough to the NavMesh"

Expected results: Custom Navmesh Agent Type should be working as well as the default.

Reproduced on: 5.6.2p4, 2017.1.0p2, 2017.2.0b5, 2017.3.0a2.

Comments (6)

  1. 81f07eef0fc9fb0c2435de300fae8345?d=mm

    firecat91

    Apr 11, 2020 12:49

    I know this is long after this issue, but I actually downloaded these components, followed the directions to add it to my project, but it doesn't work. It just comes up with a bunch of errors because some functions don't seem to exist.

    These are:
    [Execute Always]
    EditorSceneManager.IsPreviewSceneObject
    StageUtility
    UnityEditor.AI.NavMeshBuilder.CollectSourcesInStage

    I tried to look up solutions to this, but all of them point back here.

  2. 087e9c5f0530e6468513f55cec2f85d2?d=mm

    LoekvanKooten

    Dec 24, 2018 13:30

    Sorry, but this design is plain stupid. If you give us the possibility to use different agents, then please also support them in the default Unity version, not by sending us to GitHub and have us compilie software ourselves. This is Windows, not Linux. So please, provide a way to bake new NavMeshes for different agents - from Unity's own interface.

  3. Dfe95a2b18eb8084312e904304a5b198?d=mm

    Epok

    Dec 01, 2018 19:03

    If this is intended, then why not have NavMeshSurface in the official build? Why is it Github and why did I spend 24 hours researching this? You release updates so often that a lot of the official tutorials I see online are confusing since the UI is out of date. Movement AI is a very crucial part of most games too.

  4. 2605b29b7b080293491dad330a760d4e?d=mm

    phobos2077

    Jun 08, 2018 11:51

    I have stumbled upon this today and spent a good chunk of my day trying to find what's causing the issue. IMO, you should revamp the navigation system to make it more clear. Sending the user to download some code from github is strange, either make all related components built in (including NavMeshSurface) or remove the Bake functionality from UI completely and make it be controlled manually from code. This way it will be less confusing.

  5. E0275bc6ec145ac3587374efccb83fa5?d=mm

    vandijkstef

    Nov 18, 2017 10:44

    Maybe remove agent types unless you have that extra component?
    Or notify us when we create a new agent?

  6. E11d4ca5e5537b01cefb749efebca10e?d=mm

    adriant

    Aug 01, 2017 17:45

    Thank you for reporting this issue. The behaviour is actually the expected one. Every agent type needs its own separate NavMesh (in your example one for the Humanoid and one for the Robot). The warning message "Failed to create agent because it is not close enough to the NavMesh" wants to give a hint about the fact that there is no NavMesh available for one of the assigned agent types (Robot).
    The NavMesh baked from within the Navigation window of the editor can only be used by the Humanoid agent. No other agent type can use it, including the Robot.
    But multiple agent types can be used in Unity. In order to bake NavMeshes for other agent types you need to use the NavMeshSurface component, which can be downloaded from our official GitHub repository here https://github.com/Unity-Technologies/NavMeshComponents . Please read the manual section on this topic in order to get more information about how to set it up https://docs.unity3d.com/2017.2/Documentation/Manual/NavMesh-BuildingComponents.html .

    We will resolve this issue by providing improved warning messages for similar situations.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.