Strange behaviour of ScriptableObject reference at Inspector

I am experiencing very strange behaviour of unity engine…

public [abstract] class ActorGeneral : ScriptableObject
{
    public string Name;
    public Sprite Portrait;
}

There is inherited specific class from above.

But if I write [abstract] at above base class, derived specific scriptableObject’s inspector’s reference missed when turn off Unity and turn on Unity again after save scene, save project.

If I remove [abstract] at above base class, derived specific scriptableObject’s inspector’s reference live as normal.

And before hit the play button, this scriptableobject says there is script error and fix it, but just after press play button and play, its gone and works again.

Why this happen, how to fix?

You can not use an abstract class as an object only direved classes.

Then what is this?
https://learn.unity.com/tutorial/create-an-ability-system-with-scriptable-objects#5cf5ecededbc2a36a1bd53b7

So abstract class can’t be assigned to inspector’s variable’s value? Even if it is scriptableobject?

I didn’t see the whole tut, but in the scripts on that page i dont see abstract anywhere. Abstract class can only be used as a base class, inherit a class from it and use that.

1 Like

Of course I assigned inherited specific class, not abstract class itself.

Why do you have square brackets around the abstract keyword?

BTW, the first script starts with this :slight_smile: :

public abstract class Ability : ScriptableObject {

@ Just for emphasize and easy to let you know, of course not used as-is like at code.

Oeps ;p