Dialogue box closing too early

I am trying to make a dialogue box that comes up from the bottom using a tween and goes down using a tween. Same for a text object that uses Yarn. Coming up and showing text works. I want it to change the line of text by pressing the enter key and to close (move down) the text box by using enter too. I can not figure out how to make it check if all the text has been showed and then be able to close the text box. I only get it to change the line and close the text box at the same time.

Here is the code:

And this is the text box that comes up from offscreen and returns to offscreen:

Two events are firing when Return is released: the event that controls the UI animation and the sub-event that goes to the next dialogue line. You need to make sure that the dialogue UI event only runs when dialogue has ended i.e. finished showing the last line of dialogue.

Add this condition (inverted ‘Dialogue is running’):

image

…under the trigger once in this event:

image