Hi, I’m making a simple event where the player picks up a certain item and then a widget is added to the viewport where there’s text box saying how to use the item and then disappearing. I tried this functionality with a delay but It doesn’t work and I don’t really know how to use the timer thing so I would appreciate some help on how I can make it disappear and not display it forever. I tried with removeallwidgets, remove from parent, and toggle visibility but it doesn’t disappear.
Use a timer. If my understanding is correct, the delay operates on the same thread processing the thing it’s working in, potentially holding up other things it might want to do; that entire thing delays, not just the single-train-of-logic it happens to live in.
A timer spins off a distinct entity/thread (for lack of a better word) and then can call a function or event, on it’s own, and not in the way of anything else in that object.
Create a event/function to display the widget and another to make it disappear. Then in the display-event, call the timer at the end. The display function terminates, but the timer is off to the side so x-seconds later it will come along on it’s own and execute the close/hide function.