The script class needs to derive from ScriptableObject error.

I get this error when trying to CreateInstance of a class that inherits from ScriptableObject.

“The the script class needs to derive from ScriptableObject.”

This is so weird, because the error message is the exact opposite of the truth!!!

The class absolutely does inherit from ScriptableObject.

It turns out that you’ll get this error if the class is abstract.

For example, you’ll get this error when calling


if the MyScriptableObject is defined like so:

using UnityEngine;

public abstract class MyScriptableObject : ScriptableObject

In order to fix it, you’ll need to make the class not abstract.

This appears to be a bug in Unity.

Not a bug. You cannot instantiate abstract classes. See abstract - C# Reference | Microsoft Learn
“Members marked as abstract, or included in an abstract class, must be implemented by classes that derive from the abstract class.”
What the abstract keyword allows you to do is define a class that is not completely implemented. If you were to create an instance of such a class and then call a method on it that lacks an implementation, the universe explodes. It does anyway, kinda, but you get my point.