I was using 2017.1.1f4 (or whatever the latest ‘official’) version is, and navigation was working fine, but since it crashed about 10 times daily I upgraded to the latest patch version, 2017.1.1.p4.
Now, the navigation doesn’t seem to work: I get told “Failed to create agent because it is not close enough to the Navmesh”. The navmesh still exists, I tried rebuilding it, but nothing works. I can get the character’s starting point within centimetres of the navmesh below it but I still get the “not close enough” error.
Anyone know what’s going on? I’ll have to revert to the ‘stable’ version until I can resolve this. (It does work as usual once I revert.)
I was having the same issue after upgrading from 2017.1 to 2017.2.0f3. The problem was solved after reviewing all the properties of agents and navmesh (I think the height and step-height of Humanoid agent were different from the right values) and baking the navmesh again.
I filed a bug report, but the QA person didn’t bother to read it properly and closed it. He said:
"Unfortunately, this sounds more of a feature request than a bug. NavMesh itself seems to be working as intended. Unless it’s your specific occasion, error does depend on the distance between NavMesh and NavMeshAgent (throwing an error starting at 9 units)."
The object is not even ONE unit away and I get this error. Very angry at their QA right now.
I too get warning “Failed to create agent because it is not close enough to the Navmesh”. A see - prefab spawn similar NavMesh. 0_0
Then I use NavMesh.SamplePosition for get real NavMesh point. But no effect.
And I find root of this error - unHumanoid agent type!
I set agent type to Humanoid and script worked perfectly, without warning.
But what will done? I need different unHumanoid agents type!
Sometimes the agent settings for that type don’t match the ones set on the navmesh itself. I don’t know why that would cause this problem, but sometimes it does. HOWEVER that is not the problem I have. I have Humanoid for everything.
This code here actually worked for me, solving the problem completely. Unfortunately, there’s no way that I can shut off or get rid of the initial “failed to create navmeshagent” debug error now. I’ll just have to live with it.
For me it’s instantiating a prefab with a navmeshagent that made it so that it couldn’t create it. Any time one of my objects that needs to be instantiated is created now I get the problem.