The beauty of Scriptable Objects in Unity3D
I wish I knew about them in my early days with Unity3D
I’ve been working for almost 10 years already, and I discovered Scriptable Objects a few years ago, and that was an amazing discovery.
I am a big fan of Scriptable Objects!
One of the main advantages I see with ScriptableObjects is you can create them as an asset file on your project, shared among different Game Objects across your project and you don’t need to attach them to a specific game object.
Here some more advantages:
- They are editor-friendly,
- They can be handled with the usual unity Instantiate, Enable, Destroy pipeline.
- They are quite friendly with the Unity serialisation system and can be serialised via reference.
- They are great for prototyping.
And my favourite one they are great for organizing assets:
- Sound Effects/Music for your game.
- Sprites
- My personal favourite one: GameBalance. For my own projects, I usually have a scriptable object to represent different aspects of the game balance of the game.
For example, minimum health value for our hero player to die.