Setting Up Your Unreal Project for Yarn Spinner
When you use Yarn Spinner, you write your dialogue in .yarn files, and a .yarnproject file says which of them belong together. You bring these files into your Unreal project by dragging them into the Content Browser, and Yarn Spinner imports them like any other asset:
- A Yarn Project (
.yarnproject) is compiled on import, byysc, the Yarn Spinner compiler. The result is a Yarn Project asset, which is what a Dialogue Runner runs, so this is the asset you give the Dialogue Runner. - A Yarn Script (
.yarn) isn’t compiled on its own. When you save one, Yarn Spinner reimports every Yarn Project that includes it, and they compile again. You can import a.yarnfile too, as a Yarn Source File asset, but you don’t need to.
Yarn Spinner also adds a few items to the Content Browser’s menus, Yarn Spinner headers in the Details panel, and two Project Settings pages.
- Yarn Projects: which scripts a project includes, how it compiles, and what the Yarn Project asset shows.
- Importing Yarn Files: what happens when you add or change a
.yarnfile, including edits made outside Unreal. - Editor Tools: the Content Browser menus and icons, autocomplete for VS Code, the Project Settings pages, the Debug HUD, and what Yarn Spinner adds to the Details panel.