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):
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.
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!
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.