Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to disable NavMeshAgent specific warning

Discussion in 'Navigation' started by Luchunpen_0, Nov 17, 2022.

  1. Luchunpen_0

    Luchunpen_0

    Joined:
    Aug 7, 2014
    Posts:
    58
    Hello guys !

    I have a large NavMesh surface area. There is generated decorations with obstacles in random places. Then there is generated characters with navmesh agent component in random places.
    When a characters are spawned into an obstacle area, they are then automatically teleported to the nearest available surface, but before that they drop this warning:

    "Failed to create agent because it is not close enough to the NavMesh".

    Is there a way to disable this specific warning (suppose without warning ID)?
     
  2. DwinTeimlon

    DwinTeimlon

    Joined:
    Feb 25, 2016
    Posts:
    300
    not afaik.
    You have to make sure the Navmesh is available and the position of the agents is close enough to the NavMesh.
     
  3. Luchunpen_0

    Luchunpen_0

    Joined:
    Aug 7, 2014
    Posts:
    58
    Тhe navmesh is available. Characters spawn only in navmesh area, but spawn points can be in obstacles area (obstacles generated in random point).
     
  4. androvisuals_unity

    androvisuals_unity

    Joined:
    Mar 23, 2020
    Posts:
    47
    Then you need to write some kind of check to see if the point is inside an obstacle, if it is then plot a new point and check again.
    Trust me, you'll want that error at some point in the future if you somehow keep spawning things in obstacles.
    Fix the thing that causes the error, don't remove the error message.
     
  5. AnaWilliam850

    AnaWilliam850

    Joined:
    Dec 23, 2022
    Posts:
    36
    You have to make sure the Navmesh is available.
    I hope I have been helpful