Pause script while object is invisible

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SqrtTwo

I’m creating a dialog box system, currently, the dialog box will start off as hidden and will only be shown once the player steps on the area that triggers the dialog box to appear. However, i made my dialog box so that the text will be displayed letter by letter (like in most RPGs), but since the code is running before i get to the trigger, the text has already been written… is there avoid this?

If you post the code of the dialog (particularly the part tha makes the text show letter by letter) I can help you more, but basically what i would do is only play the animation if visible of the dialog is true

p7f | 2018-12-31 19:10

Already fixed it… it was a really dumb mistake, used ‘‘is_visible’’ instead of ‘‘FatherNode.is_visible’’ so it was checking if the text was visible instead of the whole node :v.

SqrtTwo | 2019-01-01 04:16

Without seeing your code it’s hard to say, but it should go something like this. You have a string that holds the text as displayed on the screen. When you trigger the dialog you run a function that clears this and starts the timer that appends letters to this display string so the typing doesn’t occur until the dialog is actually shown. When you hide the dialog you just turn off the timer, so if it’s the middle of typing it’ll stop.

uzimonkey | 2019-01-01 10:11

Glad to hear you solved it. Could you post an answer and select it so other see is resolved?

p7f | 2019-01-01 16:16