Scriptable objects showing as No MonoScript

I’m restructuring my code and got the idea of putting all the scriptable objects code into a namespace.
It seems to work but when I create the object, the field Script is missing the script, saying No MonoScript.
I thought it was because of the CreateAssetMenu attribute as numberkrunch didn’t use it in this post , but wrote an editor script following his steps and got the same result. Even though, it displayed the intended behaviour in his tests.
I really wish to put all these scriptable objects together… is there any way to make it work?

namespace BBMM.UI.ScriptableObjects
{
    [CreateAssetMenu(fileName = "New Size Preset", menuName = "BBMM/Size Preset")]
    public class SO_UI_SizePreset : ScriptableObject
    {
        public string presetName;
        public Vector2 realSize;
        public UnitType unit;
    }

    [CreateAssetMenu(fileName = "New Object", menuName = "BBMM/Object Container")]
    public class SO_UI_ObjectList_Item : ScriptableObject
    {
        public string objectName;
        public GameObject prefab;
    }
}

Scriptable objects follow the same rule as Monobehaviour: their classes must be placed in a cs file with the same name as the class in order for the Unity serialization system to be able to identify them. This means you cannot have multiple SO or MB classes defined in the same file.

1 Like

aw got it. That’s sad, but thanks for the reply!