Failed to create agent because it is not close enough to the NavMesh
Hey,
I'm currently getting an error: Failed to create agent because it is not close enough to the NavMesh,
I have done some digging around and have been able to locate my Nav agent except it is why far away from what I have actually built in my scene.
I was wondering if anyone has a solution to this...
Thanks, DarthShmev.
using the humanoid agent does not give error with those created yes
Answer by Creativa2 · Oct 08, 2017 at 10:38 AM
I met the same problem, when i tried to instantiate a gameobject with nav mesh agent enabled.
(However when i set my nav mesh bigger it didn't throw error, this part i don't understand.)
I fixed this by not enable the nav mesh agent default, i set an iEnumerator to turn it on after 0.1f. By the way this could solve a problem also when after instantiate agent teleports the object.
public IEnumerator HoldNavAgent() { yield return new WaitForSeconds(0.1f); pathFinder.enabled = true; target = GameObject.FindGameObjectWithTag("NavTarget"); pathFinder.speed = speed; pathFinder.SetDestination(target.transform.position); }
Answer by NotCqmo · Feb 20, 2020 at 05:37 PM
For Future people having the issue: Setting the base offset in the "Nav Mesh" component worked for me.
Answer by ownvikas1245 · Nov 01, 2017 at 08:09 AM
well, simple solution to this problem is to scale the whole scene and navagent to lot lower .So that their is no memory related issue in the computer to bake the larger area with larger memory allocation.
Answer by Aequitatis · Jul 26, 2017 at 04:16 PM
Sounds like you have an issue with the prefab you're using for your agent. If the entire object is out of scene, it just sounds like you've created it at the wrong coordinates. Can't tell much more without more information.
Your answer
Follow this Question
Related Questions
Enemy attack radius 4 Answers
On collision enter next scene 2 Answers
Enemy AI using pathfinding to avoid obstacles 1 Answer
How to fix this problem? 1 Answer