Problem with editing a struct that is passed around a lot

Ok here are my Blueprintexamples:

I set up 2 structs (inventory and item, inventory has an itemarray, item just has a Name).

PlayerController has an inventory and a widget. When I create the widget and gets the reference to it, i give it the reference to my inventory using the function SetInventoryRefernce. Now the widget will work with my inventory and all changes it does within its own logic, will affect my inventory directly because i passed it down as Reference. So the widget dont need to get any references by itself.

When i add a new item to my inventory, i call UpdateWidgetContent and give my widget the altered inventory as reference.

When inside the widget the drop action is triggered, means it changes the inventory. Because im working with the reference, i only need to know what Index the dropped item inside the inventory had, and remove that index from the inventory.

To optimize that a bit, i would move the Add Item and Remove Item as functions to the inventory struct. But i lack in time right now :wink:

Maybe this will get you a step closer to what you wanna do.

btw. to explore circular dependencies, you should alter the depth and Breadth within the reference viewer too.

What would a StaffMember say now?

make it a great day :smiley: