Multiple characters

claudius_I

New member
Hello, I have a question. I have two characters that need to have their own inventory. I think each character can have their own inventory, but my question is: How could I open one or the other inventory interface for each character (to equip items. press key I)?

Thanks

Claudio
 
Have you checked this documentation page?

It's about split screen which might not be exactly what you want. But it does explain how to setup the UI and inputs so that each player can have its own Inventory UI both controllable at the same time.
 
I think it doesn't help me much, I've realized that I need to have two inventories, one for each character, but only in one menu. Is this possible?

inventory.PNG

Thanks Claudio
 
Of course.

In that case you have two choices.
1) Have two seperate InventoryGrids that you open individually. Each poiting to a different Inventory either using the InventoryIdentifier ID, or by referencing the Inventory directly in the Inspector.
Untick the option to use the PanelOwners Inventory for at least one of them.

2) You can have a single InventoryGrid, and in code you can set what Inventory it shows. To do that call the SetInventory(inventory) function on the InventoryDisplayPanelBinding (usually the parent of the Inventory Grid) or the InventoryGrid directly. You might need to call Redraw after that
 
Thanks, I have another problem. I deleted an equipped item (in script) , but when open the Ui, it still appears in the Equipment UI.

inventoryEquip.PNG
 
Make sure you have the option to "draw on enable" set on the ItemSlotCollectionView component (or any other ItemViewSlotContainer like the InventoryGrid) or on the InventoryDisplayPanelBinding component (that should be on the parent of the ItemViewSlotContainer)
 
Hello, I am now in the localization phase. I have tried to locate Save UI, but have not been able to. I have located other elements with no problem, but save UI is different.
"Save View" is created game time and I have not known how to call the method that locates
Any advice?
Thank you
localiceOhter.PNG
 
The SaveGrid is quite similar to the InventoryGrid. The elements in the list are spawned at runtime.
So what you should do is find the prefab that is spawned and then edit the text there. Just like you did for the other ActionButtons.

(I don't have the project open so I can't send you a screenshot, but you should be able to find the prefab that is spawned on a component within the SaveGrid gameobject).
 
Top