# Using Six-Segment Wheel

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.

## Using the Six-Segment Dialogue Wheel

To use the Six-Segment Dialogue Wheel [make sure your Unity project has the Yarn Spinner package installed](https://docs.yarnspinner.dev/2.4/using-yarnspinner-with-unity/installation-and-setup), and the [install the Dialogue Wheel for Yarn Spinner package](https://docs.yarnspinner.dev/2.4/add-ons/dialogue-wheel/installing-dialogue-wheel).

Then, create a new Dialogue Runner in your Hierarchy:

<figure><img src="https://1350824522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUzduXovTOfMmBpZ0Wi%2Fuploads%2F7JJ3yzYxIUOBnX71Kval%2FScreenshot%202023-11-23%20at%203.30.39%E2%80%AFpm.png?alt=media&#x26;token=db7382e5-1589-428f-bce1-45e2832eee31" alt="" width="563"><figcaption><p>Adding a new Dialogue Runner to your scene.</p></figcaption></figure>

{% hint style="info" %}
If prompted, click the Install TMP Essentials button to install TeshMesh Pro (TMP).
{% endhint %}

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:

<figure><img src="https://1350824522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUzduXovTOfMmBpZ0Wi%2Fuploads%2FcbTMCx0M5FC2Fl3TEOjF%2Fdialoguewheel2.png?alt=media&#x26;token=685ddc33-3579-4843-a0c5-b4547f99baca" alt="" width="528"><figcaption><p>Creating a new Yarn Project asset in the Project pane.</p></figcaption></figure>

Similarly, also in the `Narrative` folder, create a new Yarn Script to use:

<figure><img src="https://1350824522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUzduXovTOfMmBpZ0Wi%2Fuploads%2FzBqkvQ4UTmwIbwxZ87lL%2Fdialoguewheel3.png?alt=media&#x26;token=aff78d74-52f2-4b12-83be-e60fcb5e13f4" alt="" width="531"><figcaption><p>Creating a new Yarn Script asset in the Project pane.</p></figcaption></figure>

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.

<details>

<summary>Initial sample story for Six-Segment Dialogue Wheel</summary>

{% code title="WheelDemoScript.yarn" overflow="wrap" %}

```xml
title: Start
---
Narrator: What brings to the pool?
-> Cleaning
    I have come to clean the pool.
    Narrator: Ah, just as I thought.
        -> I'm a pool cleaner
            Narrator: I know.
            <<jump End>>
        -> I was actually lying.
            Narrator: Oh, I see.
            <<jump End>>
-> Treasure 
    I am looking for the lost treasure of... the pool.
    Narrator: There is no treasure in the pool.
        -> WHAT!?
            WHAT?! WHY NOT? I WAS TOLD THERE WAS TREASURE HERE!
            Narrator: Nope. 
            <<jump End>>
        -> Oh, okay.
            Oh, well, I guess I'll go.
            Narrator: OK, bye!
            <<jump End>>
        -> I know.
            I know, I just wanted a swim.
            Narrator: In you get, then!
            <<jump End>>
-> No reason
    I have a fetish for pool cleaning equipment.
    Narrator: Whatever floats your boat...
        -> Thanks.
            Narrator: Uh uh.
            <<jump End>>
-> Commerce
    I'd like to buy a pool.
    Narrator: Well, it's not for sale.
    Narrator: Go away.
    <<jump End>>
-> Swimming
    I'm here to go for a swim. 
    Narrator: Well, you can't.
    <<jump End>>
===
title: End
---
Narrator: Anyway...
Narrator: Have a nice day!
<<stop>>
===
```

{% endcode %}

</details>

Back in Unity, choose the Dialogue Runner that you added to the Hierarchy, right-click it and choose Prefab -> Unpack.

{% hint style="info" %}
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.
{% endhint %}

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.

<figure><img src="https://1350824522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUzduXovTOfMmBpZ0Wi%2Fuploads%2FI2hgsRIjmNsJNpBUELZR%2FScreenshot%202023-11-23%20at%203.35.04%E2%80%AFpm.png?alt=media&#x26;token=ac0d9b1c-2fdc-45a8-a526-7fb2bd6226ee" alt="" width="563"><figcaption><p>Unpacking the Dialogue System prefab.</p></figcaption></figure>

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:

<figure><img src="https://1350824522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUzduXovTOfMmBpZ0Wi%2Fuploads%2FNBLuBdEBaDRg1wCfsYxE%2FScreenshot%202023-11-23%20at%203.35.57%E2%80%AFpm.png?alt=media&#x26;token=0ed189c3-980a-494c-9a37-1b6c3bc689f9" alt="" width="563"><figcaption><p>Assigning your Yarn Project to the Dialogue System.</p></figcaption></figure>

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:

<figure><img src="https://1350824522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUzduXovTOfMmBpZ0Wi%2Fuploads%2FkhcARm55XLsES3BsFbDY%2FScreenshot%202023-11-23%20at%203.40.45%E2%80%AFpm.png?alt=media&#x26;token=e7828d53-e369-4935-81ff-1c6744b9979f" alt="" width="516"><figcaption><p>The Six-Segment Dialogue View, added below the Canvas of the unpacked Dialogue System.</p></figcaption></figure>

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:

<figure><img src="https://1350824522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUzduXovTOfMmBpZ0Wi%2Fuploads%2Fcw0qlynQ5KnyI1Dagxbd%2FScreenshot%202023-11-23%20at%203.41.53%E2%80%AFpm.png?alt=media&#x26;token=fa0e064d-0053-4a87-82f8-b02a76b1f11f" alt="" width="563"><figcaption><p>Adding the Automatic-Layout Dialogue Wheel to the Dialogue System.</p></figcaption></figure>

If you save your scene and run it, your Six-Segment Dialogue Wheel should now be working!

<figure><img src="https://1350824522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUzduXovTOfMmBpZ0Wi%2Fuploads%2F0KwPcw8wOuRHXx1ZiuOX%2FScreenshot%202023-11-23%20at%203.46.55%E2%80%AFpm.png?alt=media&#x26;token=f6962ab6-8cc2-4f8c-bec8-d6f588d967e6" alt=""><figcaption><p>The Automatic-Layout Dialogue Wheel in action.</p></figcaption></figure>

## Customising the Six-Segment Dialogue Wheel

You can specify which position on the wheel your dialogue appears using [tags in your Yarn scripts](https://docs.yarnspinner.dev/2.4/getting-started/writing-in-yarn/tags-metadata). 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:

```
title: Start
---
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:

<figure><img src="https://1350824522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUzduXovTOfMmBpZ0Wi%2Fuploads%2FRTaWrSN0f3yw0XdDvePt%2FScreenshot%202023-11-23%20at%203.54.00%E2%80%AFpm.png?alt=media&#x26;token=7bedfb32-b321-4a31-9a9e-2fc432428cf1" alt="" width="563"><figcaption></figcaption></figure>

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:

<figure><img src="https://1350824522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUzduXovTOfMmBpZ0Wi%2Fuploads%2F4n4OqKmFSKU8NGxYnAQF%2FScreenshot%202023-11-23%20at%203.57.45%E2%80%AFpm.png?alt=media&#x26;token=6892629b-9afd-4ce0-9df5-c75350369787" alt="" width="563"><figcaption></figcaption></figure>

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:

<pre><code>title: Start
---
Narrator: Show some options?
  <a data-footnote-ref href="#user-content-fn-1">  &#x3C;&#x3C;set-opt 1 3>></a>
    -> I'm an option! 
    -> I'm another option!
    -> I'm yet another option!
    -> Me too!
===
</code></pre>

Will result in this:

<figure><img src="https://1350824522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUzduXovTOfMmBpZ0Wi%2Fuploads%2FatBsXueJiFaytGNk5v2R%2FScreenshot%202023-11-23%20at%204.01.36%E2%80%AFpm.png?alt=media&#x26;token=ad195b7c-d77a-4e15-baaa-ede33107f71e" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
If you use `set-opt` to 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
{% endhint %}

Review the [provided Six-Segment Dialogue Wheel Example for more information](https://docs.yarnspinner.dev/2.4/add-ons/dialogue-wheel/dialogue-wheel-examples), or check out the guide on [Using Auto-Layout Dialogue Wheel](https://docs.yarnspinner.dev/2.4/add-ons/dialogue-wheel/using-auto-layout-wheel).

[^1]: Using `set-opt` to specify 1 option should be on the left, and 3 on the right.
