π© Choice
π© Choice
The Choice block allows you to pause an interactive experience and present buttons for the user to make a decision. The rest of the flow will depend on the button clicked, thus making it possible to create narrative or functional branches.
This block is essential for any interaction requiring explicit user selection, such as branching dialogs, action menus, or confirmations.
π₯ Entries
- in (Trigger): Triggers the display of on-screen buttons and pauses the experience.
- choice (List<Texts>): List of proposals which will generate the buttons to display. Each item in the list corresponds to a button.
- timer (Number): (Optional) Time limit in seconds before the choice expires. If this parameter is empty or equal to 0, the player has unlimited time.
π€ Outings
- (Name of each choice) (Trigger): An output is generated for each element of the "choice" list. The flow takes the output corresponding to the button clicked by the user.
- timeout (Trigger): This output only appears if a timer is set. The flow takes this path if the allotted time elapses without user action.
π‘ Example of use
Scenario: Decision in an adventure game
- The player arrives in front of a mysterious door in a dungeon.
- A variable
actionsPorteof type List<Texts> is created with the values:["Open the door", "Search the lock", "Escape"]. - The Choice block is placed in the graph and the
actionsPortevariable is selected in the "choice" field. - Three exits are automatically generated:
Open the door,Search the lockandEscape. - Each output is linked to a different sequence:
Opening the doorleads to a scene where the player encounters a trap.Search the locktriggers a mini-puzzle to find a key.Fleereturns the player to the entrance of the dungeon.
βοΈ Technical Details
- Dynamic generation of outputs: The number of "choice" outputs is determined automatically based on the number of elements in the list provided. Each output has the exact name of the corresponding element.
- Timer management: If the timer is activated, the block displays a visual countdown. Once the time has elapsed, the stream is automatically redirected to the
timeoutoutput. - Contextual variables: The block exposes the variable
lastChoice(Text) containing the label of the last choice made by the user, accessible in the following blocks.
Updated on: 04/03/2026
Thank you!
