Hi.
Maybe this tutorial can help :
it uses id number for items.
you can make a main SO with a List<YourScriptable> (your Orange and other items)
and a List<int> (the id number)
then you need to make a action (SO_GetItem) and find the index on the id list
and you can get the correct scriptable with that index
Hi Djaydino,
Awesome help, that video was quite helpful! Having you go through states literally frame by frame helped me understand this a bit more.
I'm a bit confused with a couple of things since my inventory system is different than yours.
I don't have slots, each item is created at runtime in the inventory as a UI button prefab clone, so I don't know how to get the index of the item the player clicked on?
I also added a new field for my SOs which is the ItemID since you said in the video it's great to use that to communicate with other lists/FSMs. But I don't quite know how to use this ItemID to identify the item I've clicked on either?
Right now my inventory manager is just adding items to the UI inventory and my inventory, like in the image.
Every time I grab an item I send the event AddItem to the inventory manager and also add to the inventory UI object.
Each UI button prefab holds a variable with the SO associated with them, and since they are buttons, I just click on them and send the event UpdateInventoryUI and set the text.
But is possible to do this by getting the index and then the information of the object within that index?
Thanks!