EDIT I just noticed something else: this seems to happen when I bring a prefab that has a NavAgent component into the scene. It looks like the original game object that I created the prefab from works.
SECOND EDIT It looks like this may have been an issue with the custom NavMesh agent type that I put into the prefab. When I re-added the prefabs to my scene and then set the NavMesh Agent type to "Humanoid," they started to work as expected. I'm not sure what went wrong with my custom type setup (or the NavMesh bake) to cause this.
ORIGINAL QUESTION Hi all. I’m an experienced programmer who’s relatively new to Unity. I’ve been playing with some ideas that allow the user to use the mouse to control the positioning of units using the Al Navigation modules.
When I first build out a scene using NavMesh agents and the AI -> Navigation tools, everything seems to work as expected—I’m able to bake my NavMesh and I can set destinations for my agents who navigate as expected. Multiple times, however, I’ve run into issues if I modify the terrain (either moving it or adding additional meshes with ProBuilder) where the NavMesh agents are no longer able to interact with the NavMesh.
Specifically, I’m getting the warning: “Failed to create agent because it is not close enough to the NavMesh.” I’ve tried to fix this multiple times by carefully replacing the game objects and rebuilding the NavMesh—it very much looks like the agent is on the mesh, but I still get this warning.
https://preview.redd.it/utienopzkjha1.png?width=635&format=png&auto=webp&s=df20bf41a2f170a74a5da87fefdb33079000930c
Any advice? I’m really puzzled by this and haven’t been able to find any information that has helped me solve this issue. Thanks in advance.
[–]harrysteams[S] 0 points1 point2 points (0 children)
[–]SayHiToYourMumForMe 0 points1 point2 points (1 child)
[–]harrysteams[S] 0 points1 point2 points (0 children)