I have a question, how can I make separate slots for each item (I mean chest). Could someone show or explain how to do it in chest BP?
Thanks for any help
Hey, I think there is multiple solutions to this, but in my case, the Inventory is an Actor Component, so I can simply add this Actor Component to every actor I need an Inventory on.
To notify the player that a Chest Slot has changed, you could :
1- Have a OnSlotChanged function in InventoryComp, that notify the Inventory Owner which index has changed in the array
2- When the player open the Chest, store the Chest’s InventoryComp to a variable inside Player’s InventoryComp and bind an event dispatcher on Player’s InventoryComp ( Disp_OnSlotChanged)
3- When a slot is changed on the Chest (OnSlotChanged will be called on Chest’s InventoryComp) call Disp_OnSlotChanged, so the player will be notified and can update the UI
4- When the player close the chest, unbind Disp_OnSlotChanged and clear the variable “Chest’s InventoryComp”
Could you show me on the screenshots how it should look in BP?
It’s too much to explain here, but it’s been done a 100 times over. Plenty of tutorials on YT.