Removing Child Widgets from Array

Hi everyone, I’m struggling with something that probably is an easy fix but it’s driving me crazy.

The thing is that I have a mechanic which consists on clicking elements and showing their information on screen, which works fine, but I’m implementing a functionality where the user should be able to select and delete the element info he desires.

Everything works fine and I can select and delete the elements normally managing an array of Widgets Indexes, but I cannot delete the Index 0 of the Array. Which is the first element I add on the list of elements when I click around in my scene.

Some screenshots (hope it is enough to at least make you understand what’s happening):

Here, an element correctly added to the Array.

Now, the element supposed to be ‘‘correctly’’ deleted from the Array, as long as we can see while debbuging that it has been removed.

But, as you can see, the First element (which index is 0 in the Array) cannot be deleted visually from the screen. It’s crazy and I’ve been two days struggling and trying to figure out why this little issue is happening… Because if I add 10, 20, or 7 elements, whatever, I can delete all of them always except for the first one… so… why??

Please if anyone knows what can be happening, I would be highly grateful with any response to this post.

Thank you once again!

Have you tried removing it from parent before removing it from the array? Thats the only thing I see that may be causing an issue, if not that is very strange that it is not working only on index 0.

Well it just makes more sense right, if you remove it from the array then how could you access it to remove it from the screen, you need to do everything you want to it before removing it from the array which is essentially destroying it.

No problem, you are welcome! I’m glad I could help. Could you please mark my solution as correct so that others with a simular problem can easily find the solution? Thanks! :slight_smile:

Have you tried removing it from parent before removing it from the array? Thats the only thing I see that may be causing an issue, if not that is very strange that it is not working only on index 0.

Have you tried removing it from parent before removing it from the array? Thats the only thing I see that may be causing an issue, if not that is very strange that it is not working only on index 0.

I can’t believe it… That was it!!
I just turned on the computer I tried it out and it worked!! Why is it like this??

I don’t understand why but seriously you saved my life right now. Even if it was a really ridiculous thing!
Thank you so much Steve SybrSyn!!