Search Unity

How to check if NavMeshLink is valid?

Discussion in 'Navigation' started by Spectra_7, Nov 14, 2019.

  1. Spectra_7

    Spectra_7

    Joined:
    Oct 17, 2017
    Posts:
    33
    I have this horizontal elevator (white color) with moving NavMeshSurface and a NavMeshLink on the edge of a static platform. How to check if the NavMeshLink has turned blue i.e valid?

     
  2. pluspingya

    pluspingya

    Joined:
    Aug 13, 2018
    Posts:
    1
    @Spectra_7 Did you get a solution? I'm in the same situation as this post at the moment.
     
  3. skydestinies

    skydestinies

    Joined:
    Feb 6, 2014
    Posts:
    19
    *Bump* as I would like to have a code solution as well. Obviously the code knows if it's connected, but there's no exposed function call to ask. I need this because I add navlinks at run time and so far, there's no reliable way to check if those nav links are valid without this function (I can approximate it by trying nav mesh sample position, but there's always a case where that breaks).

    Edit: Note this is specifically an issue with navlinks that have a width > 0. Because the default point navlink seems to have a tolerance whereas the width based ones require exact placement or it's not considered connected
     
    Last edited: Oct 18, 2023
  4. I have not used Unity's navigation for a while, I move on to A* Pro asset a long time ago. In theory Unity is slowly working (?) on this package, check out:
    https://docs.unity3d.com/Packages/c...@2.0/api/Unity.AI.Navigation.NavMeshLink.html
    Important: it is a pre-package, so look out for errors. The navmeshlink in this package has
    autoUpdate
    and a query if the link can be traversed by an agent or not (
    activated
    ). Since I do not use unity navigation I haven't tried it, but you may find it useful (or not).