restart text

Hello,

I have a question,

I have a widget with text that connected to text variable that change over time.
I’ve set a button that if you close the widget. click S on the keyboard the widget is closed (visibility and active)

I have a problem when I’m trying to start the widget again, the text variable is continue from the place that it was and not from the beginning.
how can I restart the text variable when restart the widget?
I tried to start the event that change the text but it’s just running 2 times.

Thank you

What exactly is stopping you from setting new value to the variable when you show the widget?

there is a text with delay… so if i change the text inside the widget still the delay changes the text…

there is a text with delay… so if i change the text inside the widget still the delay changes the text…

Either do not call the event, and set the text variable directly instead. Or add a boolean to the custom event:

sorry but I couldn’t understed :face_with_peeking_eye:
can you explain more? what is the boolean doing?

It would give you a choice whether to update the text with Delay or not.

image

If you call it with this ticked, it would run BranchTrue Or run the bottom False execution chain and set the text directly. You can add attributes to Event and Functions:

More info:

Thank you for your patience, but somehow i still don’t understand.
I know how to use the boolean but i don’t understand how its helping.
I have a text, dealy , text, dealy ,text …
and i want to start from the begging how does the boolean at the stat stop it from continue the code?
do I need to check every time i set the text if the boolean is true??
:pray:

You do not want to reset the text variable - you want reset the Delay? So the tutorial can be restarted from the beginning? And previously triggered Delays no longer trigger?

You cannot stop a Delay - they are fire & forget and will count time even when the widget is not showing.

The easiest solution is to remove the widget from viewport / container, dereference it so it can be destroyed and then create a new one.

An alternative is to write different logic, one that reads text at specific intervals using a Timer - it’s like a Delay but you can pause / stop and reset it whenever you want.

so how can I destroy the widget and create a new one?
:pray:

so how can I destroy the widget and create a new one?
:pray:

Widget destruction is automatic once a widget is no longer referenced by anything. This will do:

Every time you call this event, if a tutorial was running, it will be removed. And a new one will be added. You can create reference variables by right clicking pin and promoting.

thank you very much,
this widget is on the camera of the player player in vr…there is not add to viewport.
how can i do it inside the pawn?

thank you very much,
this widget is on the camera of the player player in vr…there is not add to viewport.
how can i do it inside the pawn?