I have ScriptableObject assets that store information needed for my items/weapons. The mono script links to these ScriptableObject then uses/modifies those stats as needed. At the moment though they are linked to the parent asset and changing stats on the parent, I assume I need to create an instance of the parent asset, but not sure HOW I can use this script to create an instance of the right script procedurally. I assume on Fx Start I would make the myClass variable (the stats I will be able to change) equal to ScriptableObject.CreateInstance(). What I’m unclear on is how I would pass the argument the give me the desired effect. I need something that can work procedurally on many types of scriptable assets so that each item doesnt need its own script made to assign this instance.
I know that sometimes my posts are a bit unclear so if something doesn’t make sense say something and I’ll try to explain a different way.
How come you’re using ScriptableObjects and not MonoBehaviours? My understanding is that shared data is the intended use case for ScriptableObject, so there’s the potential you’re making life harder than it has to be, though I don’t know the rest of your use case.
I use ScriptableObjects because my inventory items won’t have gameObjects in the scene while inside the inventory. Many junk items etc won’t ever have GameObject representation so having scriptableObjects is better for my project.
Sounds to me you could live with a regular C# (System.Object) class (markedup with [System.Serializable]) instead of a UnityEngine.ScriptableObject. Use ScriptableObjects when you have like a settings file, etc.