ScriptableObject for custom items & spells in-game

Hey there.
So I’ve got an inventory set up that stores a list of ScriptableObjects that make up all of my items, including weapons and armour, etc., as well as a “Spellbook” section for holding all of the player’s spell objects. The player can equip a sword SO that references a mesh, which will be displayed on screen, but all of the damage calculation happens through the stats held within the SO.

ScriptableObjects are great for quickly creating objects inside the editor, but if I want to implement some sort of system where the player can create their own objects with custom stats, is there any way to do this with SO’s?

I want the player to be able to go into a spellmaking interface, where they can select a “Fire Projectile” or “Heal Self” type and then set the variables for damage and speed inside that interface, then save all of this to a spell object that gets added to the “Spellbook” list. I guess what I’m describing is the process of making a SO through “Assets->Create” in the editor, but in the game instead. Is this possible?

This concept also extends to creating enchantments for weapons and armour as well. If the player has an Iron Sword that’s the same as all the other Iron Swords (due to being created through a SO), and they want to create an enchantment that modifies the damage of that weapon, or the weight or any of the predefined stats from the SO, would this be possible?

Basically will SO’s work with these ideas or will I have to go back to using prefabs with monobehaviours?

Thanks, hopefully that all made sense!

Scriptable Objects are more configuration and settings items. You can use them for templates and let the player start with a copy of a Scriptable Object you made previously. But then you will have to serialise their creation (into JSON, for example) and to load them up again when the session is restarted.

Yes and no… You can create scriptable objects at runtime but you can’t save them normally (without using asset store tools). The closest best thing would be to save the user created data like a save game with custom classes and load those into scriptable objects that you create at the start of your game. See the answers here for more details: Saving/Loading ScriptableObject during runtime - Questions & Answers - Unity Discussions