Search Unity

Get all OffMeshLink objects

Discussion in 'Navigation' started by mnxoid, Nov 28, 2016.

  1. mnxoid

    mnxoid

    Joined:
    Dec 6, 2013
    Posts:
    1
    What I'm trying to do is to make an edit-mode script that gets all off-mesh links and makes some of them bi-directional(depends whether a jump is possible).

    My (obvious) attempt was:
    Code (CSharp):
    1. FindObjectsOfType<OffMeshLink>();
    However, it returns only the links I have created manually.

    My question is the following: how to access the off-mesh links generated by unity in the baked NavMesh?

    Any help would be greatly appreciated.
     
  2. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
    Unfortunately it's not possible to modify the auto-generated offmeshlinks :(
     
    mnxoid likes this.
  3. Xepherys

    Xepherys

    Joined:
    Sep 9, 2012
    Posts:
    178
    Even if the OP's objective cannot be reached (making some of them bi-directional), is there a way to read the rest of the off-mesh links?
     
  4. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
    The auto-generated OffMeshLinks (jump/drop) are unfortunately not available for queries
    We plan to replace this concept with a more flexible one - including a better workflow
     
  5. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    296
    Is there a solution to this now?
    Why not add a single bool in there to make all auto generated offmesh links bidirectional? I'd prefer to deal with all bidirectional links than having to manually create them. My agents needs to be able to jump all over the map, can you imagine the pain of doing it all by hand?

    Is the source out there? I'd try fixing it myself.
     
    Last edited: Nov 11, 2018
    vanhalen17 likes this.
  6. jakub-gemrot

    jakub-gemrot

    Joined:
    Nov 1, 2014
    Posts:
    10
    Hi, for our project, we really need to at least read off-mesh links, simple list "start / end vector3" would be sufficient, is there a way to get them? If not, could you please send me a plugin that is able to export them? There is even an asset that is trying to mimick the built-in functionality, although not as good as the hidden black box within Unity: https://forum.unity.com/threads/navmesh-links-generator-for-navmeshcomponents.515143/
     
    Last edited: Jul 29, 2019