Hey guys, so I ran the profiler tools from session frontend on my game and I detected that my inventory system and item tooltips are very heavy on performance. It makes sense to me because I have lots of visibility and image bindings in UMG for the 36 inventory slots and for the item tooltips. And those bindings all get fired 2-3 times per frame!!!
My question is, how do you prevent the bindings from running 2-3 times per frame? Or is there a way to code visibility or setting of item icons without using UMG bindings?
I tried with the stack size text on the inventory slot, and I could program it in beginplay of the inventory slot so the stack size gets hidden for items that can’t stack. But the problem is that this only happens on beginplay. And if I then pick up an item, or unequip an item that IS stackable, the stack size text will still be hidden because I did it in beginplay.
Also, is there a way to detect if a variable or array is changed? If so I can code it to call a custom event or function to set the visibility or icon bindings only when a item gets added to inventory as opposed to doing it 2-3 times per frame with a regular binding.
Also, I have added the UI_inventory to the main HUD, which is always active. Is there a way to make inventory code only run when the inventory panel is actually opened?
Thanks in advance!