📦Installation
This tutorial shows you how to install Yarn Spinner for Unity, the Unity integration for running Yarn and Yarn Spinner scripts in your Unity-based games.
The main way we recommend to install Yarn Spinner for Unity is via the Package Manager.
Install via the Unity Package Manager (recommended)
You can install the Yarn Spinner package into your project using the Package Manager window in Unity.
Yarn Spinner is available via the OpenUPM registry. This is the simplest way to install Yarn Spinner, and makes it easy to keep it up to date.
In order to follow the instructions in this section, your project needs to be using Unity 2020.1 or higher. If your project is using an earlier version of Unity, we recommend installing Yarn Spinner from Git.
Setting Up the OpenUPM Registry in Your Project
Before you can install Yarn Spinner from OpenUPM, you first need to configure your project so that it knows where to get the package from.
In Unity, open the Edit menu, and choose Project Settings.
In the list of sections at the left hand side of the window, select Package Manager.
This window is where you tell Unity about where to find packages that come from registries besides Unity's built-in one.
In the Name field, type
OpenUPM
.In the URL field, type
https://package.openupm.com
.In the Scopes field, type
dev.yarnspinner
.Click Save.
When you're done, the settings window should look like this:
![](https://docs.yarnspinner.dev/~gitbook/image?url=https%3A%2F%2F99231152-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FS4mXHmtpu6Jra6GMq89c%252Fuploads%252Fgit-blob-9ffc8d7043c45fa1fa36c6865b735bc8180c3666%252Finstalling-unity-package-manager-registry.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=1ab89e17&sv=1)
You can now install Yarn Spinner itself.
Installing the Yarn Spinner package
Open the Window menu, and choose Package Manager.
In the toolbar, click Packages: In Project, and choose My Registries.
![](https://docs.yarnspinner.dev/~gitbook/image?url=https%3A%2F%2F99231152-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FS4mXHmtpu6Jra6GMq89c%252Fuploads%252Fgit-blob-4b36cb70469b92bbc1976649e0a4efca76a4d829%252Finstalling-unity-package-manager-select-package-list.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=d284990f&sv=1)
Yarn Spinner will appear in the list. Select it, and click Install.
![](https://docs.yarnspinner.dev/~gitbook/image?url=https%3A%2F%2F99231152-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FS4mXHmtpu6Jra6GMq89c%252Fuploads%252Fgit-blob-39d975f5cf3b8bd1432becad8215db25d46cb9a5%252Finstalling-unity-package-manager-registry-select-package.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=c2f12d4c&sv=1)
Yarn Spinner will download and install into your project.
You can verify that everything is imported succesfully by looking for Yarn Spinner under Packages, in the Project pane.
![](https://docs.yarnspinner.dev/~gitbook/image?url=https%3A%2F%2F99231152-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FS4mXHmtpu6Jra6GMq89c%252Fuploads%252Fgit-blob-c2f12a9b2c98158463950633699e0a6b4ac14589%252FScreen%2520Shot%25202021-03-07%2520at%25202.16.14%2520pm.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=ef9890e8&sv=1)
Install from GitHub
As an alternative to downloading Yarn Spinner from OpenUPM, you can install Yarn Spinner by downloading the package directly from GitHub, where the project's source code is stored.
Where possible, we recommend installing Yarn Spinner from OpenUPM rather than GitHub, because it's easier to update to new versions.
To install Yarn Spinner from GitHub, follow these instructions.
In Unity, open the Window menu, and choose Package Manager.
Click the
+
button, and choose "Add package from git URL".
![](https://docs.yarnspinner.dev/~gitbook/image?url=https%3A%2F%2F99231152-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FS4mXHmtpu6Jra6GMq89c%252Fuploads%252Fgit-blob-e361e2f8b9c42b4ce38b98ec19d076c360981921%252Finstalling-unity-git-select-url.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=37a72b7a&sv=1)
In the text field that appears, enter the following URL:
https://github.com/YarnSpinnerTool/YarnSpinner-Unity.git
.
Be sure to type the URL exactly as it appears in this document, or the installation won't work.
The project will download and install. This might take a moment.
Next Steps
Once you've installed Yarn Spinner, you're ready to start using it!
Last updated