- Home /
Scriptable object doesn't load in the build of the project
I am creating racing/driving a game, that uses scriptable objects as databases for cars. I am making it for android/ios and every time I build it and send the build .apk to my android device, it says that the script attached to the database scriptable object is missing or is not valid. It works fine when I play it from the editor on my phone. Can somebody please help me?
Answer by Boyaxchyan · Jul 14, 2017 at 08:05 PM
I have done some research and I found the answer and I am posting this because 400 people are currently following my question.
Scriptable objects are like any other asset in your project assets, and Unity can modify and read your assets when in the editor (a.k.a Play Mode), but when you build your game, your assets become read only files in your application. So for storing your data you should use something like PlayerPrefs (https://docs.unity3d.com/ScriptReference/PlayerPrefs.html).
You can also serialise ScriptableObject as xml/Json when you want to modify them at runtime.
Your answer
Follow this Question
Related Questions
Button as a child of a button 0 Answers
Disable/enable local notifications on Android and iOS 0 Answers
System.Diagnostics.Process on iOs and Android 1 Answer
How to display a video behind gui on mobile 2 Answers
XR Descriptor not found 1 Answer