Search Unity

Runtime NavMesh Building?

Discussion in 'Navigation' started by Scornz, Jan 1, 2016.

  1. Scornz

    Scornz

    Joined:
    Jun 15, 2014
    Posts:
    27
    Hello fellow Unity developers,

    I am currently creating a first-person puzzle game that allows the player to make their own levels and play them. The player is allowed to edit the geometry, add obstacles, and also add enemies. The enemies have patrol waypoints that the player can modify and add when they would like. My problem here is that these enemies have been built entirely from Unity's NavMesh system, and as of currently, we can only build NavMeshes at runtime in the editor using the NavMeshBuilder class. I know of the NavMeshObstacle component, but this only carves out a section of the NavMesh and this does not fit my needs. If any insight could be given to help me, I would very much appreciate it.

    Thanks,
    Mike
     
  2. cefwyn

    cefwyn

    Joined:
    Jan 2, 2013
    Posts:
    15
    I've been looking into this as well. From what I can find the only option is to create your own NavMesh implementation which of course means you would need to change your enemy AI to work with that Navmesh system as well. It would be nice if there was functionality to just pass a navmesh into the system as "pre-baked." My current project requires generating a floor mesh in almost the same way a NavMesh is usually generated so it would be trivial if I could just pass the mesh into the Navigation system but no luck finding out how so far.
     
  3. Scornz

    Scornz

    Joined:
    Jun 15, 2014
    Posts:
    27
    Thanks for the reply! Yes, I've been looking into making my own, but I would much rather use the code I already have. I have been looking into A* for quite some time and may switch, but I have no idea how to go about doing that :)
     
  4. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Untiy is aware of the limitation and is working on it. But, it won't land shortly in Unity. It was planned for Unity 5.4, but didn't make it. So the earliest will likely be 5.5 which is planned for June.
    http://unity3d.com/unity/roadmap
     
    LeftyRighty likes this.
  5. cefwyn

    cefwyn

    Joined:
    Jan 2, 2013
    Posts:
    15
    That's great to hear. I understand why NavMesh generation isn't included into the engine by default because it's usually not trivial, but there are plenty of cases where the ground mesh could just be copied as the NavMesh unless I'm totally misunderstanding how Unity handles it's navigation system. It'll be interesting to see what's done in the plan.
     
  6. Scornz

    Scornz

    Joined:
    Jun 15, 2014
    Posts:
    27
    Yeah, I was looking at the roadmap a little while ago and noticed it was the only one marked as delayed on the list :D
     
  7. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    So, this content:

    Means that "Bake API" will be a runtime-bake option to build up the navigation even if the terrain is dynamically generated?
     
  8. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Yes
     
    Ash-Blue likes this.
  9. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Posts:
    813
    Nice! , MUCH needed functionality ..
    abouts June is okay i guess :/ lol
     
  10. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    Im really looking forward to the navmesh api. Especially run time baking. If anyone has any new docs about it please post a link.