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
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.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Error in console when using the progress bar API along with Texture compression
- NullReferenceException when selecting a Dropdown Component override in the Prefab Overrides menu for the second time
- USS variables are broken on IOS
- Crash when project is reopened or upgraded
- Hub doesn't install windows 10 sdk properly
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.
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.
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.
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.
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?
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.