A FAQ for the various components overall Yarn Spinner project.
Yarn Spinner for Unreal is moving from Yarn Labs to Core Components in 2025-2026.
// 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: 5stringListener.Dispose();public override void SetValue(string variableName, float floatValue)
{
// (code for updating the variable omitted)
// Notify the change listeners that this variable changed
NotifyVariableChanged(variableName, floatValue);
}variableStorage = GameObject.FindObjectOfType<InMemoryVariableStorage>();
float testVariable;
variableStorage.TryGetValue("$testVariable", out testVariable);
variableStorage.SetValue("$testVariable", testVariable + 1);static int myNumber = 10;
// note: all Yarn Functions must be static
[YarnFunction("getMyNumber")]
public static int GetMyNumber() {
return myNumber;
}
// Yarb Commands can be static or non-static
[YarnCommand("setMyNumber")]
public static void SetMyNumber(int newNumber) {
myNumber = newNumber;
}My number is { getMyNumber() }!
<<setMyNumber 999>>
But now it's { getMyNumber() }!Player: Sure would be nice if I could take a breather [pause /] right now.if (player presses SPACE)
then find the nearest NPC
get that NPC's dialogue node name
call DialogueRunner.StartDialogue() with the NPC's dialogue node
disable player movement