playMaker

Author Topic: How to bake a Navmesh at runtime ?  (Read 4875 times)

EverySingleSoldier

  • Playmaker Newbie
  • *
  • Posts: 26
How to bake a Navmesh at runtime ?
« on: July 13, 2017, 01:44:37 AM »
I generate random terrain with tiles that are set as Navigational Static and some not, how do I initiate the NavMesh bake after the map has been generated ?

Is there a BuildNavMesh action in Playmaker ?

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: How to bake a Navmesh at runtime ?
« Reply #1 on: July 13, 2017, 03:14:57 AM »
Hmm, that is a good question. I dont think playmaker has it yet, and I havent played with that new function in 5.6. However.

I see there is a tutorial on how to do it. I will give it a watch later and see how/if to write some/a action for it.
« Last Edit: July 13, 2017, 03:49:30 AM by tcmeric »

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: How to bake a Navmesh at runtime ?
« Reply #2 on: July 13, 2017, 03:49:08 AM »
So after watching the tutorial, it doesnt seem like any scripting is necessary. Basically you need two scripts from the unity github account for navmesh runtime. Add those to your game objects and select the area to cover.

I havent tried it, but I suspect you could also make an empty gameobject, add the script, set the size, make it a prefab. Then you can use playmaker to place the prefab at run time, covering the new area you created. (Which will then be added to the navmesh runtime updater).

Checkout the tutorial around 4 minutes I believe.