Is clearing children the same as removing children?

Hey there,

Hopefully a quick Question.

I’m essentially resetting a uniform grid to update unlocked characters.

So it doesn’t just keep creating more widgets and overlaying them in the grid. I’m planning to remove and then rebuild the menu when the player goes back to it with the new updated list, pictures etc.

I usually use remove child to send it to Garbage disposal. But I just can’t get any of the remove child nodes to act the way I want. I swapped it out for clear children and boom, working instantly.

So my question is, do they act the same? Is clear children, basically just “Remove all children”?

Reading it over now as I type it…It does feel pretty silly to ask this I guess.

I just wanted to double-check.
Thanks for reading!

Tdlr: Is removing and clearing doing the same job, just worded slightly differently?

Hi there, as far as I’m aware (i’m sure someone will correct me if not) clearing is the same as removing. If you think about it, you are working with a dynamic array. So everytime you click the button to see your characters unlocked items you are creating the array based on logic like current xp versus required xp, so it will dynamically fill the list with all the unlocked items… you click somewhere else, get more xp and go back and you’ll want it to run the same calculation logic from scratch and fill up the list again so yes, you are doing it correctly, the first thing to do in that logic is clear the array and then let your logic fill it up from scratch. I hope that clarifies things for you. :slight_smile:

1 Like

Awesome, thank you!

I’m a bit particular with the wordings of things (Multiple choice exams are a nightmare :grin:)

So when faced with most of them using the word remove and a solo node using clear. Makes me wonder why they wouldn’t of called it “Remove all children” rather than clear children. Made me wonder if there’s more to it than just phrasing itself.

Especially If you’re new to unreal, you might be searching for “Remove” rather than “children” or “clear” and get thrown around a bit.

It’s really finding a problem where no problem is to be found :rofl:. But interesting phrasing nonetheless.

Thanks again for a speedy clear response :slight_smile:

1 Like

I know, it can be difficult to attain the right terms in your head, especially with blueprints when you are constantly right-clicking and searching for a node to do something. But I suppose with time it becomes clear :laughing:

I would imagine remove may be used in a different scenario, perhaps with a more persistent dataset or perhaps to remove a specific item, or replace one… clear I guess is a blanket remove all but don’t quote me on that haha I’m sure there’s a more correct version to that thinking :metal:

1 Like

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