What is ScriptableObject

“A class you can derive from if you want to create objects that don’t need to be attached to game objects.
This is most useful for assets which are only meant to store data.”

I use C# and I use the new keyword to instantiate scripts that are not meant to be attached to a game object.
Is it better to use a ScriptableObject?
Can someone give me a sample code that demonstrates what it’s good for?

Thank you

What do you mean by ‘scripts’? Are you just talking about creating objects of struct and/or class types via ‘new’?

Sorry I mean creating instances of classes.

It depends on what you want to do. The scriptableObject class has some clear benefits over general System.Object extending classes but if you just need a runtime object for something, then its an overhead, then extending System.Object is more than enough.