Yarn Scripts
Learn about Yarn scripts, which are the assets that contain the dialogue you write.
A Yarn script is a text file containing your dialogue.
Yarn scripts need to be added to a Yarn Project in order to be used in your game.

Creating a New File

To create a new Yarn script in Unity, follow these steps:
  • Open the Assets menu, and choose Yarn Spinner -> Yarn Script.
  • Unity will create a new file. Type in a name for the file, and press return.
Creating a new Yarn script.
The new file that you've just created will contain a single node, which has the same name as the file.
Creating a Yarn Script in Unity is exactly the same as creating a .yarn file externally (i.e. in macOS Finder or Windows Explorer), and dragging it into the Assets folder of your Unity project, or directly into the Project pane (where the new Yarn Script we created through the process above appeared) in Unity.

Editing Yarn Scripts

To edit a Yarn script, double-click it in Unity. The file will open in your editor. When you save your changes and return to Unity, it will be re-compiled.
You can learn about our recommended editor, Visual Studio Code with the official Yarn Spinner Extension at: Editing with VS Code.
Export as PDF
Copy link
Edit on GitHub