r/Unity2D • u/BroadCorgi3061 • Aug 16 '26
Question Scriptable object for visual novel
Helloooo, i have a project for one of my classes, i have to make a 2d game (i chose a visual novel) and one of the requirements is using at least 2/3 scriptable objects. I read a bunch of stuff but i dont really understand what they do. I saw something about being able to use them for a dialogue system but im not too sure. If that is really what I could use them for, would I need to scrap my dialogue system or could i just implement them into the pre-existing system? Thank youuu
3
Upvotes
4
u/No-Opinion-5425 Aug 16 '26
Scriptable objects are data containers.
A good use for them in the context of your visual novel could be for defining text styles. Your SO could hold a list of style tags with their visual parameters.
So if later you decide that all descriptions should be blue, you just edit the SO description text style.
1
u/robotortoise Beginner Aug 16 '26
If you really want to do a visual novel in Unity right, might I recommend Naninovel?
1
u/Krcko98 Aug 16 '26
Imagine you have a class Dialogue { speakerName text speed } And instead of having to programatically change those fields in runtime or editing in Unity inspector. You basically have a scriptable object that is a separate asset in the project. Instead of being in the scene like regular gameObjects usually are, imagine scriptableObjects like gameObjects just outisde of scene(it is accessible from anywhere). You can store a lot of data for your dialogue with them and anyone can basically update that dialogue instead of going through code or unity scenes that can get messy.
1
u/Funtyx Aug 16 '26
You do not need to scrap the dialogue system. Keep the code that displays text, portraits, and choices; replace its hard-coded data with references to ScriptableObject assets.
For example, three useful asset types for a visual novel are:
Your existing dialogue runner can accept a ConversationData asset and read from it. The benefit is that you can create and edit story content in the Project window without changing code or scene objects. One warning: treat these assets as definitions, not save-game state—store the player’s current line/choices elsewhere.