I followed a tutorial on using scriptableObjects to store data about inventory items and retrieve them.
It works great. I expanded it to allow for multiple types of items through class inheritance. So potions have health variables. Weapons have damage variables etc.
That also works for the most part but when I first open Unity, and from then sometimes loading a new scene, I get an error that each ScriptableObject is a script that can't be loaded. When I select the scriptableObject and hit play it reconnects and is fine. I end up selecting all and after hitting play they all work. It's a pain but it's manageable.
But when I try to make a build the scriptableObject items aren't working. Any idea what could possibly be causing that behavior? I have no idea where to even start to troubleshoot. Any help in the right direction would be greatly appreciated. Thank you.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
3 People are following this question.
Custom Editor not working :(
Serializing a ScriptableObject without creating an asset for it?
CustomEditor for an ScriptableObject asset only works after recompile.
How can I display a ScriptableObject as a list inGame?
Why isn't my CustomEditor's OnInspectorGUI() running?