Bernkastel
Member
I would like to have a DoNotDestroyOnLoad main Inventory for the player, however my player prefab is instantiated at runtime at the beginning of every level. I made a separate game object to hold all the player's inventory/currency data and made it do not destroy, however it seems that InventoryInteractor.cs requires the Inventory to be on the same game object. Is there an intended way for me to have a persistent inventory with a non persistent playable character? I wanted to assign the Inventory at runtime to the player prefab but it is protected which I assume is by design and required.
I am also making my Inventory Canvas persistent which is partly why I want to keep the inventory itself persistent. My player prefab had a dynamic panel owner and inventory identifier. On initial load for the first player prefab it sets itself as the owner and works as intended. After switching scenes and re-instantiating the prefab it does not re-assign itself as the owner of the panel. The inventory on the player saved and maintained its item collections, however they were not displayed in the UI after scene transition.
I am also making my Inventory Canvas persistent which is partly why I want to keep the inventory itself persistent. My player prefab had a dynamic panel owner and inventory identifier. On initial load for the first player prefab it sets itself as the owner and works as intended. After switching scenes and re-instantiating the prefab it does not re-assign itself as the owner of the panel. The inventory on the player saved and maintained its item collections, however they were not displayed in the UI after scene transition.