Pardon our dust while we move our docs here. The Godot (GDScript) docs are on this site, and the Yarn language, Unity, Godot (C#) and Unreal docs are still at docs.yarnspinner.dev.

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 are 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. 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 press Run Current Scene. 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.