Step 5: Add Player Choices

Add branching dialogue with Selection nodes and choice UI.

Step 5 — Add Player Choices

Add a Selection Node

Go back to the Dialogue Editor and open your MerchantGreeting sequence.

  1. Delete the connection between the merchant’s greeting and the player’s response
  2. Drag a Selection node from the palette and place it between them
  3. Connect the merchant’s Text node FlowOut to the Selection node’s FlowIn

Configure Choices

Select the Selection node. In the Inspector:

  1. Set Question Text to "What would you like to do?" (optional — displayed above the choices)
  2. Add options in the Selection Options list:
    • Option 1: "Browse your wares"
    • Option 2: "Tell me about the town"
    • Option 3: "Goodbye"

Each option creates a dynamic FlowOut slot on the node.

Branch the Conversation

Now connect each output to different dialogue paths:

  1. “Browse your wares” FlowOut → New Text node (Merchant: "Take a look around!") → End
  2. “Tell me about the town” FlowOut → New Text node (Merchant: "This town was founded...") → End
  3. “Goodbye” FlowOut → New Text node (Merchant: "Safe travels!") → End

Your graph now branches based on the player’s choice and each branch leads to a different response.

Selection UI Component

On the UI side, the DialogueUISelectionComponent displays the choices to the player:

  1. On a UI entity, add a DialogueUISelectionComponent
  2. Configure it with a button prefab for spawning choice options
  3. Register it with the UI Bridge

When the sequencer hits a Selection node:

Sequencer reaches Selection node
    → UIBridge.RunSelection(options)
        → DialogueUISelectionComponent.DoSelection(options, performerData)
            → Spawns choice buttons
                → Player clicks a choice
                    → OnSelection(index) fires
                        → Sequencer follows the chosen FlowOut

Random Branching

For variety without player choice, use a Random node instead. It picks a random output each time the sequence reaches it. Optionally configure weights to make some branches more likely.

Next: Conditions and Effects