Hi guys!
I’m struggling a bit to wrap my head around a feature I want to implement in my game. Essentially what I’m trying to do is drop an item from my player’s inventory in the next scene and save that object in that scene. For example if a player finds an axe in the forest and goes inside the cabin in the forest (other scene) and drops that axe, goes outside and comes back later in the cabin, the axe is gone.
I have a basic Player inventory that allows the player to pick up items and put it in their inventory. With the right icon selected the player can also drop the item. All of this works great in a scene. The issue arises when I go to the next scene. The player inventory is a persistent gameObject so all the items are still there. The player can even drop and pickup the objects in the other scene. However, when an item is dropped and I go out of the scene to another one and come back, the item is gone.
This does make sense to me since a different scene has its own objects and settings etc. that are initialized at the beginning. Therefore it holds no reference to the dropped item that came from another scene. Hence an item dropped is therefore not saved.
But is it possible to do this? And if so how? I was thinking somewhere along the lines of prefabs that are instantiated if need be, but to be honest I have no idea how this type of workflow goes in Unity.
Any ideas or suggestions? I have the Easy Save 3 asset pack which works wonders, can I do something with that perhaps?
I hope I explained it properly, I’m terrible at it