Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

Samples

The samples are small scenes that each show one part of Yarn Spinner for Godot (GDScript), with the Yarn Scripts and GDScript that make them work. Open one, run it, then look at how it’s built.

The samples come in two ways. If you bought Yarn Spinner+, they’re in the samples folder of your download. Otherwise, they’re a separate Godot project in the YarnSpinner-Godot-Samples repository on GitHub. They’re for the GDScript version of Yarn Spinner, and don’t work with Yarn Spinner for Godot (C#), which has its own samples.

Getting the samples

  1. Copy the samples folder from your download into your project, so that it’s at res://samples.
  2. Make sure the addon is installed and the Yarn Spinner plugin is turned on. See Installation.

The Samples browser in the Yarn Spinner tab finds the samples there. The Classic RPG add-on’s sample uses the characters and art in samples/shared, so copy the samples folder to try it.

  1. Clone or download the YarnSpinner-Godot-Samples repository.
  2. Put the addon in the samples project, so that its plugin.cfg is at res://addons/yarn_spinner/plugin.cfg. The samples project doesn’t include the addon: its addons folder is empty. Copy or link the addon the same way as for your own project. See Installation.
  3. Open the samples project in Godot, and turn on the Yarn Spinner plugin in ProjectProject SettingsPlugins if it isn’t on already.

The first time the project opens, Godot imports every sample’s Yarn Project, which takes a moment. If a Yarn Project says “No compiler available”, see The compiler.

Running a sample

Each sample is a folder in samples, with a scene you can run. Open the scene and click Run Current Scene. In the samples project from GitHub, running the whole project starts Yarn Basics.

Or use the Samples browser in the Yarn Spinner tab. Click Samples in the tab’s toolbar, and each sample has a card, with buttons to Play it, Open its scene, or read its Docs. See Editor Tools.

The Samples browser in the Yarn Spinner tab, with a card for each sample showing its thumbnail, a short description, and Play, Open and Docs buttons
The Samples browser in the Yarn Spinner tab.

What the samples share

Many samples use the same pieces, which are in samples/shared:

  • samples/shared/ui has the Line Presenter, Options Presenter and option button scenes that most samples use.
  • samples/shared/scenes has the player and the other characters, and a ready-made dialogue setup that Welcome and Simple 3D use.
  • samples/shared/scripts has the scripts for moving characters around, following them with the camera, and letting the player talk to a character when they’re close to it.
  • samples/shared/art has the characters, environments, fonts and textures.

If you copy a sample into your own project, copy what it uses from samples/shared too.

The samples

Getting started

Connecting to your game

Showing dialogue

Voice-over

Saliency and storylets

Get started Welcome A spoken introduction to the samples, with a custom Presenter that builds slides on a projector screen from lines of dialogue.