💡Frequently Asked Questions / "How Do I...?"
Common questions and solutions for using Yarn Spinner in Unity.
Text
How do I style text? How do I make some words bold, italic, colorful, etc?
Alice: This text is <b>bold!</b>
Bob: This text is <color=red>red!</color>
// NOTE: '#' is a special character in Yarn, used for line tags.
// To use a HTML color hex code, you must "escape" the "#" character with a "\"
Carol: Wow I'm <color=\#ff00ff>purple</color>!How do I animate wavy text, like in Night In The Woods?
How do I use Yarn Markup?
// Yarn script example of custom "wavy text" markup.
Oh, [wave]hello[/wave] there!
// After compiling, text will look like: "Oh, hello there!"
// And then the resulting markup data will look like:
// - name: "wave"
// - position: 4
// - length: 5Variables
How do I print the value of a variable in dialogue?
How do I read / write Yarn variables from a C# script?
How do I read / write C# variables from a Yarn script?
How do I 'sync' variables between Yarn and C#?
How do I load and save data / variables / dialogue state? (Like for a save game system)
Control flow
How do I jump to a specific node? How do I switch nodes while dialogue is running?
How do I jump to a specific line in a node?
Interaction / UI
How do I continue dialogue with key/button press instead of clicking the continue button?
How do I show the last line of text when options are shown? How do I skip the last line of text before a set of options?
How do I show the character name / portrait? How do I customize dialogue display?
How do I make the Line View's Typewriter effect pause on punctuation?
How do I play a Yarn node when I click / tap on an object?
How do I play a Yarn node when I approach an object and press a button? (RPG-like talking to NPCs)
How do I position a speech bubble above an NPC's head, like in A Short Hike?
How do I implement a resizing dialogue bubble / SMS messaging interface?
How do I get text from a Text Input field into my Yarn story?
System
How do I generate a Yarn Project at runtime? How do I load/compile Yarn scripts at runtime?
How many Yarn files should I have? Can my entire game be in one project or script? Or one project per scene? Is my project or file too big?
I'm seeing crashes on startup in my WebGL / iOS / Android / IL2CPP project.
Localization
How do I fetch any Yarn localized string in C#?
Other
How do I credit Yarn Spinner in my game?
Last updated
Was this helpful?
