Widget BP stay alive even after RemoveFP/CG

Hello everyone, thank you for your attention if you read my message.

I’m having a problem using blueprint widgets. where a widget still persist to exist even after being ‘remove’.
As illustrated below, I create a widget that displays text on the player’s screen.
I also bind an event to a blueprint that lets me know when the text has been completely displayed.

When the text has been completely displayed, it calls the associated event, and the widget is removed via the remove parent method, and I also call the garbage collect method.

But, it turns out that even after these two methods have been called, the event associated with the widget to pass the text dialogs (Event Key E) continues to be called even though the widget has theoretically been removed.

I’ve been racking my brain for hours without understanding what’s causing this, and I’ve got my own idea as to why the widget persists, perhaps via the bind event, but I’ve already tried to unbind all the events created or to destroy the widget later with a delay, and I’ve also checked that it wasn’t recreated later, but none of these solutions were conclusive.

So, if anyone has any ideas on how to solve this, I’d love to hear from you, thanks again.

Widget will work differently, remove from parent won’t destroy the object but just remove it from viewport.
After 60s garbage will check if that specific widget is on screen, then will destroy it.

I tested <60s will return true. >60s will return false.
Garbage Collector node most likely is not doing anything(or is limited for widget it seem).


61s because gc auto trigger after each 60s (using project default setting)

Ok I see, so in that case, how do I block the events? Do I handle it with a var bool or something else?
Is there no other solution?

If it just for testing, maybe saving the widget in a variable and then set it to null might do the trick to force GC.

Otherwise i recommend to let ue5 handle it since gc will get trigger by itself each 60s.

Okay then, don’t want to pass more times on this, thanks!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.