How do I stop dialogue at the end?

How do I…

How do I make the dialogue stop running after the last line plays?

What is the expected result

I want the player to be able to press x after every line to move to the next line and for the dialogue to stop running at the end of the text.

What is the actual result

On the first line, I can still press ‘x’ to run the second line, but then it immediately plays the second line and loops back to the first line.

Related screenshots


When your dialogue finishes the condition ‘dialogue is not running’ becomes true again, so your dialogue loops. You could use a boolean variable like ‘dialogueHasFinished’ to test that it’s set to False in a condition. When the dialogue runs an action changes the variable to True, so the dialogue can’t run again. Alternatively, there are other conditions like ‘Branch has been visited’ that could also be useful for stopping the looping. You could invert that condition to test that the branch Start has not been visited yet.

But that won’t take care of hiding the dialogue UI stuff when dialogue ends. You’d need to do that in another event. I typically have an event that has ‘dialogue is running’ as a condition, and another separate event with ‘dialogue is not running’. In the first one I show everything, and in the second I hide everything. I did a 19 minute dialogue tutorial recently that shows a typical simple Yarn set-up. It might be helpful to refer to.