Hello…
I’m trying to build a small inventory widget, where you can pick up objects, like notes, books n stuff
and get a picture and some text in an inventory. it kind of works, but i ran into a problem.
my setup is that every time you pick up an object it gets added into an “inventory” array and the pickup function
then calls a custom event to refresh the inventory widget to add a button and text to the inventory.
my problem is that the refresh event doesnt just create one button for the new item. but it does so for all items in the array (well yeah, the way i did the blueprint its kinda supposed to do that, i get that), so every time i pick up a new item it adds buttons for all items in the array duplicating to the already created buttons.
now my workaround was to take the output of the completed pin (of the foreachloop) and set that to the create widget button, it kinda works, but i don’t know if thats a good idea, also it now recreates the whole array everytime i pick something up, right? performancewise i wanted it to just create one additional button for the one item i picked up and keep the item buttons i picked up before. would that be a better solution?
does anyone has any idea how to set this up properly. help would be highly appreciated