Last updated
Was this helpful?
Last updated
Was this helpful?
Yarn Spinner for Unity ships with a range of samples covering common patterns for things you might want to do in your game.
Once Yarn Spinner for Unity is installed, you can install the Yarn Spinner for Unity Samples Package.
The best way to install the samples is to use the Samples button on the inspector of any Dialogue Runner, Yarn Project, or Yarn Script, or by choosing the Window menu -> Yarn Spinner -> and clicking Install Samples Package.
Clicking on this will work out the best way to install the samples depending on how you installed Yarn Spinner itself.
While the best way to install samples is the above, depending on your environment and device setup this might not be possible. In those circumstances you will need to manually install the samples, which is what this section is about.
How you manually install the Samples depends on how you installed Yarn Spinner:
The Yarn Spinner Samples are another Unity Asset Store asset.
This package is free but does have a dependancy on the main Yarn Spinner for Unity asset.
Click on the "Add to My Assets" button.
Your browser should now offer a popup asking if you want to open the samples in Unity.
Click on the Open in Unity button.
The asset store will now bounce you back to Unity and start installing the samples.
Once the Yarn Spinner Samples package is installed in your project, you can install each individual Sample by opening the Unity Package Manager through the Window menu -> Package Manaing, locating the Yarn Spinner Samples package, and switching to the Samples tab:
You'll find the Sample in the Project pane:
You can open the Unity Scene (in this case Main
) to explore the sample.
To install the Yarn Spinner for Unity Samples, you'll need to have a Unity project with Yarn Spinner for Unity installed, so head over to first.
Open your browser and navigate to
To work with each individual Yarn Spinner for Unity Sample, click the Import button next to the Sample that you want to install, inside the Unity Package Manager. For example, to add the sample to the project, click its Import button:
- a small scene in which a character explains Yarn Spinner's inbuilt samples and what each of the others include.
- walks through the various major features of Yarn Spinner.
- demonstrates the creation of pools of lines or nodes which can be drawn from based on current game state to deliver dynamic, contextual content.
- demonstrates basic customisation of dialogue views with a custom font, view background, and continue button texture.
- demonstrates more elaborate customisation of dialogue views such that they are styled like a text message conversation on a phone screen. This includes how to add lines or options to the screen when a new line is received, as opposed to the default view which replaces the previous line or options.
- demonstrates creation of custom options view and behaviour such that the player is given only a limited amount of time to choose once dialogue options are presented.
- demonstrates localising a dialogue view
- demonstrates the use of multiple Dialogue Runners to allow different types of NPC background conversations simultaneously with each other or during primary dialogue.
- demonstrates the use of Action Markup to insert command-like triggers in the middle of dialogue line delivery.
- demonstrates the use of Replacement Markup to insert text styling or dynamic content into dialogue lines as they are presented.
- demonstrates the creation of a custom way to score and choose between content in node or line groups at runtime.
- demonstrates the use of node groups, line groups, and dynamic line content together to make a fully dynamic scene.
Learn about the samples we provide for Yarn Spinner for Unity.