Step 5: Add Player Choices
Add branching dialogue with Selection nodes and choice UI.
Categories:
Step 5 — Add Player Choices
Add a Selection Node
Go back to the Dialogue Editor and open your MerchantGreeting sequence.
- Delete the connection between the merchant’s greeting and the player’s response
- Drag a Selection node from the palette and place it between them
- Connect the merchant’s Text node FlowOut to the Selection node’s FlowIn
Configure Choices
Select the Selection node. In the Inspector:
- Set Question Text to
"What would you like to do?"(optional — displayed above the choices) - Add options in the Selection Options list:
- Option 1:
"Browse your wares" - Option 2:
"Tell me about the town" - Option 3:
"Goodbye"
- Option 1:
Each option creates a dynamic FlowOut slot on the node.
Branch the Conversation
Now connect each output to different dialogue paths:
- “Browse your wares” FlowOut → New Text node (
Merchant: "Take a look around!") → End - “Tell me about the town” FlowOut → New Text node (
Merchant: "This town was founded...") → End - “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:
- On a UI entity, add a
DialogueUISelectionComponent - Configure it with a button prefab for spawning choice options
- 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