arrow-left

All pages
gitbookPowered by GitBook
1 of 3

Loading...

Loading...

Loading...

Start Here

If you're new to Yarn Spinner, or want a refresher on getting started or navigating the documentation, then this is the place to be.

Yarn Spinnerarrow-up-right is a set of friendly tools for writing interactive narratives and games.

Try Yarn Spinner online at try.yarnspinner.devarrow-up-right!

Yarn Spinner is easy for writers to use, but also has powerful features for programmers, game designers, narrative directors, producers, and more.

Try Yarn Spinner online at https://try.yarnspinner.devarrow-up-right

Yarn Spinner is used in thousands of amazing games, including Rift of the Necrodancer, Demonschool, Night in the Woodsarrow-up-right, A Short Hikearrow-up-right, Lost in Randomarrow-up-right, Dredgearrow-up-right, Frog Detectivearrow-up-right, Button Cityarrow-up-right, Escape Academyarrow-up-right, Baladinsarrow-up-right, and Unbeatablearrow-up-right.

hashtag
What to do next

1

before you start working with Yarn Spinner. It's the best place to keep up to date, get support and advice, and share what you're working on

2

Yarn Spinner includes a narrative scripting language, Yarn, that allows you to write your game narratives, quests, and logic in a friendly format. The Beginner's Guide will start you off on your path to learning Yarn Spinner.

hashtag
Yarn Spinner powers amazing games, including:

... use it to power your game too!

Yarn Spinner 3.1

Yarn Spinner for Unity 3.1 contains a number of improvements and useful changes.

hashtag
Dialogue Runner Is Now More Async

The dialogue runner's StartDialogue and Stop methods are now async, and return a task. When you call StartDialogue

3

Use Yarn Spinner in Unity, Godot, or Unreal

Once you're comfortable writing Yarn Scripts, you can integrate Yarn Scripts with a game engine, such as Unity, Godot, or Unreal. Buy one of our useful add-ons, too, if you need it!

4

Build a Game

Simply draw the rest of the owl.

5

Tell us about your gamearrow-up-right and Credit Yarn Spinner

We'd love to hear about your game, and show it off when we talk about awesome Yarn Spinner-powered games. And please, don't forget to include a credit for Yarn Spinner!

Join the Yarn Spinner Discordarrow-up-right
Join our friendly community Discordarrow-up-right
Read the Beginner's Guide
Cover

New? Start Here!

Cover

Scripting Fundamentals

Cover

Advanced Scripting

Cover

Yarn Spinner for Unity

Cover

Unity Add-Ons

Cover

Community Discord

Cover

Show us your game

Cover

Crediting Yarn Spinner

Cover

FAQ

Cover

Story Solver

Cover

Yarn Spinner for Godot

Cover

Yarn Spinner for Unreal

Cover

DREDGE

Cover

A Short Hike

Cover

Lil' Guardsman

Cover

Demonschool

Cover

Little Kitty Big City

Cover

Rift of the Necrodancer

Cover

Venba

Cover

Unbeatable

Cover

Luma Island

Cover

NORCO

Cover

Night in the Woods

Cover

ENA: Dream BBQ

, you'll receive a task (either a
System.Threading.Tasks
task, a
UnityEngine.Awaitable
, or a
UniTask
) that will complete after every dialogue presenter has finished running its
OnDialogueStartedAsync
method. Likewise, the
Stop
method will finish after every dialogue presenter has finished running its
OnDialogueCompleteAsync
method. This is really useful for making sure that you don't accidentally make a change to your scene in the middle of your dialogue presenters getting ready.

hashtag
Dialogue Option Fallthrough

In Yarn Spinner, you can add a condition to the end of an option. If the condition evaluates to false, Yarn Spinner will mark the option as "unavailable". It's up to your game to decide what that means - you might want to make the option visible but unselectable, or you might want to hide the option from the player entirely. However, if every option is unavailable, the player has no option they could select. Previously, this could cause your game to have to soft-lock the player, since they weren't able to proceed.

In Yarn Spinner 3.1, dialogue presenters are now allowed to tell the Dialogue Runner that no option was selected at all. When this happens, Yarn Spinner will skip the options and move on to the next part of the script:

circle-info

You can turn off this behaviour by setting the allowOptionFallthrough property on your DialogueRunner to false.

hashtag
Lines Know Where They Came From

When Yarn Spinner sends a line to your game, it wraps up the line in an object called a LocalizedLine. Previously, if your game has multiple Dialogue Runners that are running at the same time, it wasn't possible to know which runner the line came from. In Yarn Spinner 3.1, the LocalizedLine now has a Source property that tells you where it came from.

hashtag
Options Can Now Be Hurried Up And Cancelled

Just like how lines have a separate 'hurry up' and 'next' cancellation tokens that act as a signal to move things along, options now have the same 'hurry up' and 'next' tokens. (Previously, they only had a single cancellation token that signalled that option selection was no longer necessary.) This allows your game to signal that you want to hurry up the presentation of your dialogue's options.

hashtag
New Typewriter System

We've updated the way that typewriters are used in the built-in Line Presenter system, to make it easier to customise. This is useful for when you want to take full control over how the line appears over time, and for when you want to have in-game events occur (like sound effects) as the line appears.

To create a custom typewriter, create a class that implements IAsyncTypewriter. You can find an example of how to write a custom typewriter in the source code for the LetterTypewriterarrow-up-right class.

circle-info

As part of this change, the On Character Typed event on Line Presenter has been removed. If you want to run code every time a character appears, create a new script that subclasses from ActionMarkupHandler, and add that to an object in your scene. Add that object to the Line Presenter's "Event Handlers" list. In your ActionMarkupHandler subclass, you can write code that gets called every time characters appear on screen by implementing the OnCharacterWillAppear method.

hashtag
Removed Legacy DialogueView Classes

Yarn Spinner 3.0 introduced a new programming model for presenting dialogue, called Dialogue Presenters. As part of the rollout of this new API, we made the old DialogueView class act as a compatibility layer, and marked it as deprecated. Yarn Spinner 3.1 removes this deprecated code. If you have code that started life as a Yarn Spinner 2.0 project, you will need to migrate your legacy dialogue presentation UI code to use Dialogue Presenters.

Guard: Who goes there?

// If the player is a thief, a royal visitor, or a merchant, then
// go run the appropriate conversation for that. The player might be
// some combination of the three, so let them choose.
-> A thief! <<if $player_is_thief>>
    <<jump Guard_Thief_Conversation>>
-> A royal visitor! <<if $player_is_royal_visitor>>
    <<jump Guard_RoyalVisitor_Conversation>>
-> A merchant! <<if $player_is_merchant>>
    <<jump Guard_Merchant_Conversation>>

// But if the player is NONE of those, then none of the options would have
// been available. We'll fall through to here.

Player: I'm nobody!
<<jump Guard_Nobody_Conversation>>

Yarn Spinner 3.0

Yarn Spinner 3 came out on 16 May 2025! Celebrate!

Yarn Spinner 3 is out! It's the culmination of 10 years of Yarn Spinner development, taking inspiration from how people use Yarn Spinner in wildly successful and amazing games like DREDGE, Lil' Guardsman, A Short Hike, and Demonschool.

For the development of Yarn Spinner 3, stewardship of Yarn Spinner moved from our original game development studio, Secret Labarrow-up-right, to a whole new entity focused solely on Yarn Spinner development. It's now our primary job!

Yarn Spinner is developed in the open on GitHub, and can be purchased from the Yarn Spinner Itch.io Storearrow-up-right or the Unity Asset Storearrow-up-right.

circle-info

You can hire us to add features you want to Yarn Spinner, build games, or help you customise and integrate Yarn Spinner. Email us at hello AT yarnspinner.dev

Yarn Spinner 3 introduces so many improvements and new things, and makes writing complex interactive narratives easier than ever.

Get started with Yarn Spinner 3 via the !

circle-info

If you've got a project that's in development already in Unity, and you want to move from Yarn Spinner 2 to Yarn Spinner 3, visit .

hashtag
Yarn Spinner powers amazing games, including:

... use it to power your game too!

Beginner's Guide
Upgrading from Yarn Spinner 2
Cover

DREDGE

Cover

A Short Hike

Cover

Lil' Guardsman

Cover

Demonschool

Cover

Little Kitty Big City

Cover

Rift of the Necrodancer

Cover

Venba

Cover

Unbeatable

Cover

Luma Island

Cover

NORCO

Cover

Night in the Woods

Cover

ENA: Dream BBQ