Skip to content

Practice integrating scripts with the UI

in this lab, you'll create an interaction that plays a line of dialog when you press a button.

---]

1️⃣ Add a UI button

  1. open the UI tab.
  2. tap the "+ Button" icon to add a new button.
  3. set the text to "Play".

---]

2️⃣ Connect the event

  • button and in the right properties pane, select "Script to run on click".
  • create a new script and enter the following

    play the sound [Voice1].
    show subtitle [Line1].

---]

3️⃣ run test

  • switch to play mode.
  • press the "Play" button to play the specified sound and subtitles simultaneously.

🎯 Next step: [Create an interaction with conditional statements and variables] (example-logic.md)