Can I save class instances in a prefab-like way?

Hi all,

I’ve been looking into this myself, but either the issue hasn’t come up before or my vocabulary is incorrect. Essentially, what I’d like to do is save pre-created instances of classes that I can assign to various components within the inspector.

For context, I’m creating an inventory system and am using a class Item to describe any items that can be stored in inventory. An object of this class would be ex. Health Potion, stackable=True, value=100. My initial approach was to create an array of inventory items at the start of the game, and then reference them by array index when working in the editor. Things would be much smoother if I can simply reference existing Item objects.

Is what I’m hoping to achieve possible? Is there an easier way I could be going about this? Any input is appreciated!

Ah you sure are a genius you want ScriptableObjects

These are the best thing about unity in my opinion i use them probably way more than I should

heres some documentation about them cheers :slight_smile: