Learn about Yarn scripts, which are the assets that contain the dialogue you write.
A Yarn script is a text file containing your dialogue.
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
.yarnfile 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.
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.