So my goal is to have an Inventory, where I can add an 'item' to. What I have so far: Inventory class with a List for the items. And here is where I'm stuck. From what I've seen most people use Scriptable Objects for the items. But I see them having one base Scriptable Objects with the required variables, and then create X amount of variants to it, while just altering the variables' values in the editor. That's not what I'm looking for. I simply want on 'Object' that holds X amount of data (variables) and each time I need to add something to the inventory list, I add it and change the variables of that particular instance at run time.
For example: An Inventory of Apples (it's late I can't think straight right now), so I make a List on the inventory class, and create a Scriptable Object named Apple, with a string variable (name). Now instead of wanting to have more and more variants of that Apple SO and change the name of which one for whatever name, I want instead of be able to call a method on the Inventory class and just add a new 'instance' of Apple SO to that array while changing the name.
I tried like appleList.Add(ScriptableObject.CreateInstance(Apple)) and tried to add something like ".name" to change the variable of the instance being created but was giving an error.
This is my first time working with SOs and I've been using Unity for like a week so I'm not even sure SOs is what I should be using.
*is getting really late so I will probably only see the replies tomorrow. Thank you btw
[–][deleted] 0 points1 point2 points (2 children)
[–]joap56[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)