Modal Window Node

Overview

The Modal Window Node instantiates a UI prefab over the dialogue — a popup window that takes full focus until the player dismisses it. While the modal is open, the Dialogue UI is hidden to prevent overlap. Once the player confirms (via the standard Continue input), the modal fades out, is destroyed, and the dialogue graph advances.

It is designed for moments where you need to show the player structured information mid-conversation — quest summaries, item descriptions, map callouts, tutorial prompts, or any custom UI panel — before the dialogue continues.


Ports

Port
Direction
Capacity
Description

Previous

Input

Multi

Receives connections from any preceding node.

Next

Output

Single

Advances to the next node after the modal has been dismissed and fully faded out.


Node Properties

Property
Type
Description

Modal Window Prefab

GameObject

The UI prefab to instantiate when this node executes. Must be a prefab — scene objects are not accepted.


How It Works

At runtime, DialogueManager runs the following sequence when this node is reached:

  1. The Dialogue UI is hidden — the CanvasGroup alpha on the DialogueUI is set to 0, clearing it from the screen.

  2. The modal prefab is instantiated as a child of the DialogueManager GameObject and moved to the last sibling position so it renders on top of everything else in the same canvas hierarchy.

  3. waitingForInput is set to true — the graph is now blocked.

  4. The player presses Continue (the same input used to advance dialogue lines), which sets waitingForInput to false.

  5. The modal window fades out over 0.3 seconds via its CanvasGroup alpha (a CanvasGroup is added automatically if the prefab does not have one).

  6. The modal instance is destroyed.

  7. The graph calls AdvanceToNextNode() — the Dialogue UI is restored on the next node that displays text.


Validation

Condition
Severity

Modal Window Prefab not assigned

Error

No incoming connection

Warning

No outgoing connection

Warning


Prefab Requirements

The modal prefab has minimal technical requirements:

  • It should be a UI prefab (typically with a Canvas, RectTransform, and child UI elements) to display correctly.

  • A CanvasGroup component is recommended on the root for the fade-out effect. If one is not present, the system adds one automatically at runtime.

  • The prefab is instantiated as a child of the DialogueManager GameObject — ensure your project's canvas setup allows UI children of a non-Canvas parent to render correctly, or include a Canvas component within the prefab itself set to Screen Space - Overlay.

  • No special scripts are required on the prefab — dismissal is handled entirely by the dialogue system's Continue input.


Usage Tips

  • Quest accept screens — place a Modal Window Node immediately after a Quest Node (Start) to show the player a quest summary card before the NPC finishes speaking.

  • Item reward displays — trigger a modal showing an item tooltip or reward breakdown before the End Node, so the player clearly sees what they received.

  • Prefab is destroyed on dismiss — each time this node executes, a fresh instance is created and destroyed. There is no state persistence on the prefab between visits. If you need persistent state (e.g. a choice already made), manage it via Dialogue Variables.

  • Player input dismisses the modal — the same Continue button used to advance dialogue lines closes the modal. There is no separate close button built in — design your prefab's visual to make it clear to the player that pressing Continue will dismiss it, or include a visible "Press [X] to continue" label within the prefab.

  • Fade duration is fixed at 0.3 seconds — this is currently not configurable per node. If a sharp instant close is needed, ensure the prefab's initial CanvasGroup alpha is 1 so the fade is visible and smooth.

Last updated