Blueprint dynamic component deletion not working

Hello to all,

I am trying to create a dynamic death component.
I have on some enemy a Widget component called HealthBar.

When the death function is fired, I do a loop on components “Widget component” from my Owner to delete them.
I retrieve them using:

During debugging, I can see the value retrieved:

However, the HealthBar widget component is not removed from the screen.

I believe it could be related to the garbage collector taking time or something like that, but when I put the “equivalent” action in the blueprint of my enemy directly using:
image

It works perfectly.

Could you please help me understand how to correctly delete the Widget component from my dynamic death component?

Thanks in advance :slight_smile:

I implemented the same code as my dynamic death component in BP Enemy.
In debug, I see the same information:

If this code is fired from my BP Enemy it works.
If this code is fired from my dynamic death component, it does not work.

For information, I am using UE 5.3.2

Nevermind, I do not know the difference regarding the execution from my BP or my component but I found a workaround by getting the widget and setting visibility to “None”

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