How to delete a child UMG from scrollbox?

I tried everything but nothing works. Have anyone experienced this?

Remove from Parent and point it at the widget you wish to get rid of.

It doesn’t work from inside the added widget. I clear scrollbox every time an item is added, that doesn’t work either.

Image from Gyazo

The number on the right shows them being Garbage Collected, too.

276387-capture.png

Adding and removing:

Image from Gyazo


If in doubt, post a screenshot of your setup.

It does work like that. But mine is a quest system. I set the item in the array as “claimed” but when I refresh the list, claimed ones also reappear. Boolean check doesn’t work.

Does anyone know?

Does anyone know?

No one will answer unless you make things clear. You posted a snippet of things happening behind the curtain. It’s impossible to tell what is going on and how you expect it to work.

Removing widgets from parents works absolutely fine. My guess is that you’re mismanaging references; just seeing how you do not store the create widget reference makes it quite jarring.

Print says hello but it still adds to scrollbox if the boolean is true. I don’t understand why.

I’m adding the quests from an array to scrollbox,with a generic quest widget.

When you press the “claim” button, quests refresh, but it also adds the claimed one again. Even with the branch, when branch goes true.

Your branch is checking against the default value of the struct. If you modify Claimed?, the default data from the array will not update.

When you press the claim, it updates the array value. That’s why it prints true.

You need to look into Set Members In Struct node to avoid all those crazy wires. Also, why loop if you know the index already?

Yea you are right. I removed the loop but it’s still the game. It does delete the widget but when it refreshes, claimed quests still appear.

So what happens when you print the boolean before the branch leading to the spawning widget?

There are 3 quests right now. Claimed one prints true and then false. That’s why it’s in viewport I guess. How do I fix it?

276551-untitled.jpg

I figured it out. There was an index problem between different arrays. Thank you for your help.