I am following this tutorial to create a game with random generated mazes:


I want to add some monsters to roam around the newly created maze. How can I create navmesh for this kind of random generated environment?

  • 1
    \$\begingroup\$ Please describe here what you're doing. We will not go and read the tutorial; all the information to answer your question should be posted here. \$\endgroup\$ – Vaillancourt Mar 23 '16 at 13:50
  • \$\begingroup\$ AFAIK Unity does not have any options to create or update a Navmesh at runtime, you'll have to build it yourself which imho is not a trivial problem to solve. \$\endgroup\$ – Niels Mar 23 '16 at 15:19

You could achieve something similar to what you are describing using NavMesh Obstacles. The idea here is that you would create a flat surface that has a baked Navmesh on it, then place walls that have the NavMesh Obstacle Component attached.

This will cut out the NavMesh around each wall, given you the desired effect. Although I've used obstacles before, it's only ever been on small NavMeshes so I can't comment on how efficient this solution would be for you.

A tutorial on NavMesh Obstacles can be found here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.