Skip to content

Setup Guide — Doors

A door is an edge blocker that sits on the boundary between two grid cells. It blocks movement and line-of-sight when closed, and allows passage when open. Every door in Dungeon Crawler Framework is built from the same three parts: a mesh with an Animator, an EdgeBlockerMarker that registers it with the grid, and a target component (TriggerOpenDoor or TriggerOpenDoorTimed) that handles open/close logic.

What opens the door — a button, a lever, a key, a pressure plate, or a logic puzzle — is always a separate TriggerSource wired into the door's target component. The door itself doesn't care what opened it.


Core components

EdgeBlockerMarker

Registers the door with the grid. The Blocker Id field must match the blockerId field on both the door target component and the grid JSON export. Every door needs one.

TriggerOpenDoor

The standard door target. Opens on OnTriggered, closes on OnReleased (if Close On Release is enabled). Plays animator triggers, updates the grid blocker state, and guards against closing while the doorway is occupied.

Field Description
Blocker Id Must match EdgeBlockerMarker.blockerId exactly.
Close On Release When enabled, the door closes as soon as the source deactivates (lever pulled back, plate emptied, etc.). When disabled, the door stays open until something else closes it.
Skip Close Guard Skip the occupancy check on close. Enable only when the trigger source is on the same cell as the door and the guard would wait forever.
Button Release Delay Seconds after the close animation starts before a connected WallButton springs back. Set to roughly the length of your Close animation.
Open Sound / Close Sound Audio clips played at the door's world position (3D spatial).
Door Sound Volume Volume for both sounds (0–1).
Door Animator Animator on the door mesh child.
Open / Close Anim Trigger Animator trigger names.
Opened / Closed State Name Animator state names used by the Save System to restore the door's visual on load.

TriggerOpenDoorTimed

A door that closes automatically after a fixed delay instead of waiting for a source to deactivate. Useful for portcullises and countdown doors.

Field Description
Blocker Id Same as TriggerOpenDoor.
Close Delay Seconds the door stays open before starting to close. Default 3 s.
Door Animator Animator on the door mesh child.
Open / Close Anim Trigger Trigger names.

TriggerDirectionalDoor

A door that only opens when approached from one specific direction. Use for one-way passages and anti-backtrack corridors.


Door Animator setup

Every door mesh child needs an Animator Controller with these states and triggers:

States
  Idle_Closed     ← default
  Opening
  Idle_Opened
  Closing

Triggers
  Open
  Close

Transitions:

  • Idle_Closed → Opening — trigger Open, no Exit Time, Transition Duration 0.
  • Opening → Idle_Opened — Exit Time on, Transition Duration 0.
  • Idle_Opened → Closing — trigger Close, no Exit Time, Transition Duration 0.
  • Closing → Idle_Closed — Exit Time on, Transition Duration 0.

Trigger sources

Any TriggerSource can open a door — drag the door's target component into its Targets list.

Source Description
WallButton One-shot press. Pulses activate then deactivate in quick succession. Use with TriggerOpenDoorTimed for a "press and it closes itself" door.
WallLever / WallChain Toggle. First pull opens, second pull closes. Use with TriggerOpenDoor + Close On Release for a lever-held-open door.
WallKeyhole Consumes a key item from the cursor and opens the door permanently.
PressurePlate Activates when the party (or an enemy, or an item) is on the cell. With Close On Release, the door closes when the plate empties.
WallAlcove Activates when the correct item is placed in it. Use for item-based puzzles.
WallMultiSwitch Multi-position switch. Different positions can open different doors.
TriggerLogicGate AND / OR / NOT / XOR gate across multiple sources. Opens the door only when the logical condition is met.
TriggerSequenceGate Sources must be activated in the correct order. Wrong order resets the sequence.

Save System

Every door with a non-empty Blocker Id is saved. On load, the grid JSON is the authoritative source for whether the door is physically open or closed — the door's visual snaps to match it. TriggerSource components with a non-empty Source Id also save their activation state (lever up/down, keyhole used/unused, etc.).


Scene setup checklist

  1. Place the door prefab on a grid cell edge, oriented correctly.
  2. Add EdgeBlockerMarker to the root with a unique Blocker Id.
  3. Add TriggerOpenDoor (or TriggerOpenDoorTimed) to the root. Set Blocker Id to match.
  4. Wire the Animator: drag the Animator from the door mesh child into Door Animator and fill in trigger/state names.
  5. Place the trigger source (lever, button, plate, etc.) in the scene.
  6. Drag the door's target component into the source's Targets list.
  7. Fill in the source's Source Id with a unique string.
  8. In the Dungeon Generator: Generate Unique IDs (all doors)Build Grid (Export JSON).

Dedicated setup guides

Each source type has its own step-by-step guide:

For multi-source setups (logic gates, sequence puzzles, levers) see Door Types — 10 Examples.


Dungeon Crawler Framework — Mantis3de