Dungeon Architect for Unity 1.20 Help

Runtime Navigation

Dungeon Architect can generate dungeons at runtime so you get a new dungeon every time you play

This section shows you how to generate a navigation mesh on these runtime generated dungeons so the NPCs can move around

Setup Dungeon Game Object

Select the Dungeon game object and make sure you have the `Dungeon component in it. If not add one

Ut 13 39
Ut 13 40
Ut 13 41

Make sure Enable Runtime Navigation is checked

Ut 13 42

Build Runtime Dungeon

Set up your scene so this dungeon gets built at runtime as discussed in the section Runtime Dungeons section and hit Play

Ut 13 38

This will build your dungeon but won't build the navigation mesh, since we haven't specified the meshes that would contribute to the navmesh generation

To confirm this, do the following:

  1. Open the navigation panel from the main menu (Window > AI > Navigation)

    Ut 13 43
  2. Play your game and switch to the Scene view. Now focus on the Navigation panel, you won't see a nav mesh generated

    Ut 13 44

Setup Theme File

When we spawn prefabs from the theme editor, we'll need to set a flag on all the prefabs that would contribute to the navigation mesh generation

Open the theme that your dungeon uses

Ut 13 45

Select the Ground prefab node and inspect the properties

Ut 13 46

Make sure Affects Navigation is set. Do this for all the static prefabs (Walls, doors, fence etc)

Ut 13 47

Now run the game and you'll see the navigation mesh

Ut 13 48

You don't want holes under dynamic objects like NPCs, Keys etc

Ut 13 49

Make sure you've not set them to affect the nav mesh generation

Ut 13 51
Ut 13 50
Last modified: 24 January 2024