Widget not removing from parent

Greetings, I’m having an issue with the widget not removing from parent after the delay in my actor blueprint; my goal’s to get the widget to remove itself from the viewport after a delay of being shown.

Would anyone kindly help identify the problem and suggest a solution?

Thank you in advance!

I’m not sure if you can remove a child like this. What I suggest you, it’s inside your widget, after your event construct make itself destroy after the desired time.

Its bad practice to put so many instructions on one same line. read about Custom events. also, take note that because its in a same line, it doesnt mean it will execute from start to end. as far as i understand (and suppose) delays are instructions that stay in memory while the frames refresh, each time a frame refresh it checks on the object, when the timer is done, it should check back and continue the logic (at least thats how i think this works). so in case, im even surprised its actually creating the widget because you called a “Destroy Actor” before everything else. that means that after the 2s delay, the engine will check on the object and see theres nothing, so it doesnt knows what was coming after the delay.

I suggest you to read and see basic tutorials first, there is a good one about blueprint communication, i think its basic to know that. without changing much, cause the logic should be reworked, this is the solution to your problem.

did you try to drag out the retun value pin from the create enough cubes widget and stick it into the remove parent thing?

making a variable and connecting it doesnt worked for me either but this does. are you having trouble with creating the widget or is it just the removing? if not , chekc if the cast fails or not

butin general try this first :slight_smile:

note that the “Create Widget” event is placed on a different blueprint, not the same as the cube where you are triggering the event.

its just because he has a Destroy Actor which basically nulls any further instruction. if he deletes that destroy actor it would execute normally.

The CreateWidget on the circle is the event at the bottom of the screenshot. yes, i understand you need to destroy the actor after triggering the cube, but you cant do it before removing the widget. as i explained,if you destroy the actor, after the delay the engine wont know what to do after and just wont remove it. if you want to do everything on the cube blueprint (which i think is bad too, imagine you got 1000 different types of cubes with their totally different blueprint, you will repeat the “create widget” event on every of them) you need to do the destroy actor as final instruction, but that means it will only be destroyed after the widget dissapears, which i dont think you want. thus, send the instruction with the delayed time you want outside and let the cube destroy itself.