Comment on page
Using Six-Segment Wheel
Learn how to use the Six-Segment Dialogue Wheel, from the Dialogue Wheel for Yarn Spinner Add-On Package.
The Six-Segment Dialogue Wheel provides a dialogue wheel with a light sci-fi appearance, and can display up to six responses for your dialogue. You can specify exactly which segment of the wheel each response is located.
Then, create a new Dialogue Runner in your Hierarchy:
Adding a new Dialogue Runner to your scene.
If prompted, click the Install TMP Essentials button to install TeshMesh Pro (TMP).
Make a folder to store your Narrative in the Project pane (ours is named
Narrative), and then inside that folder, create a new Yarn Project asset:
Creating a new Yarn Project asset in the Project pane.
Similarly, also in the
Narrativefolder, create a new Yarn Script to use:
Creating a new Yarn Script asset in the Project pane.
Name both the Yarn Project and the Yarn Script something appropriate. Open the Yarn script to write your story. Then save the Yarn script and return to Unity.
We've provided an initial sample story here, if you want to test things out.
Back in Unity, choose the Dialogue Runner that you added to the Hierarchy, right-click it and choose Prefab -> Unpack.
Unpacking the Dialogue Runner prefab is exactly the same as creating your own empty GameObject and then adding Dialogue Runner and In Memory Variable Storage components to it.
This will allow you to modify the contents of the (former) prefab, in order to add the Six-Segment Dialogue Wheel as a Dialogue View.
Unpacking the Dialogue System prefab.
With the Dialogue Runner selected in the Hierarchy, drag the Yarn Project that you created from the Project pane into the Yarn Project slot in the Dialogue System's Inspector:
Assigning your Yarn Project to the Dialogue System.
Next, locate the Six-Segment Dialogue Wheel prefab, supplied with this add-on, and drag it from the Project pane, so it's below the Canvas in the Hierarchy:
The Six-Segment Dialogue View, added below the Canvas of the unpacked Dialogue System.
Right-click on the Options List View in the Hierarchy, and choose Delete. You won't need that view, as you'll be displaying a wheel instead of a list.
To make the Dialogue System aware of the Six-Segment Dialogue Wheel, select it (the Dialogue System) in the Hierarchy, and drag the Six-Segment Dialogue View from the Hierarchy into the Element 1 slot of the Dialogue Views section in the Inspector:
Adding the Automatic-Layout Dialogue Wheel to the Dialogue System.
If you save your scene and run it, your Six-Segment Dialogue Wheel should now be working!
The Automatic-Layout Dialogue Wheel in action.
You can specify which position on the wheel your dialogue appears using tags in your Yarn scripts. Specifically, you can add tags to each set of options to specify where in the wheel the option should be placed.
For example, the following Yarn script:
Narrator: Show me the positions on the Six-Segment Wheel?
-> Left Top #lt
-> Left Middle #lm
-> Left Bottom #lb
-> Right Top #rt
-> Right Middle #rm
-> Right Bottom #rb
Results in this:
If you select the Six-Segment Dialogue Wheel Prefab in the Hierarchy (under Dialogue System), you can look to the Inspector to customise these tags, among other options:
You can also use the Yarn Command
<<set-opt>>before each group of options in your Yarn scripts to specify how many options (limited to a maximum of three on either side) should appear in each column (left or right).
For example, the following Yarn Script:
Narrator: Show some options?
<<set-opt 1 3>>
-> I'm an option!
-> I'm another option!
-> I'm yet another option!
-> Me too!
Will result in this:
If you use
set-optto specify more options than the six-segment wheel can handle (i.e. a maximum of 3 options on each side), things may not work as expected