#Scriptable Objects

1 messages · Page 1 of 1 (latest)

silk socket
#

I have scriptable object called "item". It contains main things for each items, but I want so you could attach another scriptable object to it that has other data depending on item's purpose. I know how to attach, but is it possible to make variable inside first scriptable object for any scriptable objects so I could attach any scriptable object instead of specific class, because each item class might have other variables for instance food class might have food size and weapon class might have durability.

urban gazelle
#

You can't "attach" things to scriptable objects. You can reference others in them.
What I would recommend for your case though, is to make different item classes that each inherit Item as a base.

silk socket
#

Yeah, I meant reference. Thanks tho it helped ;D

silk socket
#

One more question - if "Item" is is a base of new scriptable object and there is few of them with different variables that means with different classes, how should I attach them to same variables, not all at same time, but to same variable