I am currently trying to make a list of widgets using a wrap box. What I’m trying to do is when they click on a button in the child widget, a checkmark will appear in the top right corner of the child widget. The problem is that I have multiple child widgets that will have the same function (checkmark appearing in the top right corner of the widget). I don’t want multiple child widgets to have the checkmark at once though. I came up with a system I thought would work, but it’s not. Here are some screenshots to further help.
The reason I clear them and re-create them is so if there are any other child widgets that have been clicked I can reset it and then set it to the one I had just clicked on. Where would I use this for loop? Would you be able to provide a quick example?
Okay sorry it took me a while. Here’s a picture, I hope you can see everything clearly(might need some zooming).
I also added numbers and give a bit of explanation for each
Basic HUD with all the images you have for selection. Each image is a different widget.
The widget with the image. As you can see I binded the visibility with a function so it will only be visible when the variable “isChecked” is true(on image 4)
The event when you click on the image. It’s gets all the small widgets and set the isChecked to false, that will automatically hide your check image(water in my case)
And lastly the function that set’s the visibility of your check button depending on isChecked variable.
Let me know if you have more questions
I have a question. In the 3rd picture, is that “isChecked” variable from another widget? If it is, I have more than 2 widgets, 103 to be exact lol. So, is there a more efficient way of doing this? Also, what widget are you referencing in the “Get All Widgets Of Class” node?
the isChecked variable is created in the image widget(image number 2), where we have only 1 picture and 1 checkbox(well image aswell). So if you have 100 instances of it, it doesn’t really matter, all of them will be unselected, and then the one you clicked will be selected
Haha, well look, first we get every single instance of that widget, including itself. Then sets the isChecked to false. When this is done, it locally sets the isChecked to true(the one u clicked!)