Update Inventory in runtime

Hello. Can I call an inventory update in runtime? to recalculate modify attributes?

If you click on the collections in the inspector, then an update occurs.
1648536103395.png
 
There is a function on the Item called "ReevaluateAttributes()". You can use that to re-evaluate the attribute values at runtime.
If you just have a single attribute with the modify attribute you can call "ReevaluateValue(true)" directly on it.

Another way is to prevent the attribute from being pre-evaluated and cached. It's a bit hidden but you can find the option by pressing the cog icon on the attribute:
1648540477436.png

This is less performant in some cases because it means that you will recompute the modify experssion every time you get the attribute value, which I would recommend against in 90% of the use cases.
 
Top