How do I remove a widget from my viewport?

Hello

I am trying to create a widget that appears and disappears after a few seconds.

This is the script I have:

The widget creates but does not delete. Can anyone tell me what I am missing?

Make sure it not called multiple times.

*Widget doesnt get destroy as DestroyActor but get removed from screen, if not in used, it will get garbage collected after 1min and be completely removed from memory.(unless stored in a variable)

1 Like

My bet is that you create more than one widget and only remove the last one. Others get orphaned. What calls this script?


Iā€™d move the removal to the widget itself, they can self-remove after x seconds after OnInitialised. Handy if the widgets are supposed to be temporary.