- Home /
NavMesh Agent error, will never detect ground
Hi,
I have a project I have been working on for a few months, upto this point I had been using transform.translate to do all my movement. Now I'm implementing NavMesh agents to a few GameObjects, and regardless of what I do I always get the error:
"SetDestination" can only be called on an active agent that has been placed on a NavMesh."
Steps I've taken:
1)I baked my environment marking the ground as static, I see all the purple and blue, and the NavMesh Agent is touching the ground.
2) I've created a new project and have successfully been able to use the NavMesh Agent.
3) I've deleted my library and project settings, but the issues persists.
4) I followed all steps mentioned here http://answers.unity3d.com/questions/507534/setdestination-can-only-be-called-on-an-active-age-1.html
Finally, I was able to create a new project and copy over my assets folder, and get the navmesh to work in a new scene, but I'm missing things like my custom layers and whatnot. Additionally, any saved scene from the old project still gives me the error.
Any ideas to reset the NavMesh? or suggestions on cloning a project without having to redo all the work. I'd prefer not to have to recreate my entire scenes to use NavMesh.
It actually had to do with my agent types, Humanoid would work, but no other type would, and baking a new path and agent didn't seem to work.
Answer by x4637x · Aug 08, 2017 at 07:07 AM
At the bottom of your Nav Mesh Agent component there is an "Area Mask" setting, you need to make sure that include your area in there before you bake.
Also you might want to use NavMeshAgent.Wrap() instead of something like transform.position() to place your agent onto the nav-mesh.
If all those step doesn't fix your problem, you could try increase your agent's step high for a bit, the nav-agent is quite harsh on the distance between their "foot" and the nav-mesh.
Your answer
Follow this Question
Related Questions
NavMesh giving jerky like motion 0 Answers
Toggling NavMeshAgent and NavMeshObstacle 2 Answers
check if agent reach destination 1 Answer
line in navmesh obstacle 1 Answer
Find the nearest location and move to a target outside Navigation Mesh? 1 Answer