Hi, firstly I want to say thank you - this asset is amazing and has been super helpful, and thank you for your support so far
I am facing a new issue:
<For context, my game is a first person game with an inventory and quickslot bar>
I am trying to implement saving of the quickslot bar & it's associated items that have been allocated to it from the players inventory. It is working in the sense that I can allocate several items from inside the players inventory to the quickslot bar, save the game, then exit, and load it, and the items appear in the quickslot bar correctly and I can indeed equip them, great!
But when I equip any items using the quickslot bar, then go into the inventory to see what's what, it has duplicated the item. The item is now both equipped and still where it was in the player's bag, duplicated. It is as if the player's inventory and the quickslot bar are no longer referencing the same 'ItemData' instance of the item.
I am wondering what I could be doing wrong?
[Bug] Losing reference to a shared reference on load(?)
Re: [Bug] Losing reference to a shared reference on load(?)
Hi there,
Are you getting any warnings in the console when you save or load?
Also what does ItemData derive from? Only objects which derive from UnityEngine.Object (e.g. MonoBehaviours, ScriptableObjects, etc) can be saved by reference.
All the best,
Joel
Are you getting any warnings in the console when you save or load?
Also what does ItemData derive from? Only objects which derive from UnityEngine.Object (e.g. MonoBehaviours, ScriptableObjects, etc) can be saved by reference.
All the best,
Joel
Re: [Bug] Losing reference to a shared reference on load(?)
Ahhh I did not realise that - itemData is it's own class, no mono behaviour, I'll look into that some more, thank you.
Re: [Bug] Losing reference to a shared reference on load(?)
Good news - turns out I had another class (ItemUI) that was not ES3Serializable at all, once I added those to it, it fixed it. It had a reference to ItemData that was required for saving to work.
Re: [Bug] Losing reference to a shared reference on load(?)
Glad you managed to resolve your issue
All the best,
Joel
All the best,
Joel