Why is the event not firing correctly?

Hello guys,

i created an inventory system, which works with a item databse, so its the same blueprint for all objects. Everything works fine. A couple days ago I started with creating a combine function to combine two items, remove them from the inventory and add a new one. My problem is, it works sometimes, and sometimes not.

Sometime means when i have 4 objects in my inventory “A B C D” and I combine C & D, they are removing from the inventory, creating a new item and also refreshs the widget. But if there are A & B left in the inventory, it doesnt work. They dont remove theirself from the inventory.I checked this with a print string.

What do you mean? I know it’s hard to reading someones code, but i hope you can help me. Why is this line of code firing when i remove the bottom once (C&D), but not when there are two left.

Thank you so much!

-J

  • I’d make sure at the end you foreach loop through the widgets to close them.
  • Also keep in mind that the Widget Construct can be ran multiple times, I think it is ran every time the widget to added to a parent. With that in mind, make sure on your construct, you clear the Inventory panel before adding anything.