Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Useless NavMeshAgent warnings

Discussion in 'Navigation' started by SOICGeek, May 13, 2022.

  1. SOICGeek

    SOICGeek

    Joined:
    Jun 25, 2019
    Posts:
    78
    I have a lot of agents running around that are instantiated at runtime. When they're first instantiated, they go to a "recruitment room" of sorts until they're recruited by the player. Everything in the game works fine, including pathfinding. However, I'm getting a tremendous amount of "Failed to create agent because it is not close enough to the NavMesh" spammed to the console. I understand what the warning means, but I don't understand why I'm getting it. Yes, there is a navmesh in the recruitment room, and I'm instantiating the agents right there on it. And yes, there is a navmesh in the rest of the scene where they go when they're recruited. I tried disabling the NavMeshAgent on the prefab, but that has no effect, except that I have to enable it when it's needed. As I said, everything works fine, except I have a hard time troubleshooting unrelated issues, because I keep having to wade through the warning spam.

    Is there any way to just suppress that warning? It doesn't have a warning code to #pragma disable. It also doesn't resolve to any code where it could be commented out. Unity 2020.3.33f1.

    Thanks if you can help!
     
    Last edited: May 25, 2022