How to view the data from Scriptable Objects in the Inspector

I’m making a word game to teach kids how to read and promote literacy. As part of that, I made a Scriptable Object that’s basically a bunch of nested Lists, until it reaches the bottom node:

using System.Collections.Generic;
using UnityEngine;
using Unity.VisualScripting;

[CreateAssetMenu(fileName = "New WordPronunciationData", menuName = "Word Pronunciation Data", order = 51)]

public class WordPronunciationData : ScriptableObject
{

    [System.Serializable]

    [IncludeInSettings(true)]
        public class NeemUnitContainer {
        public List<NeemUnit> NeemUnitContainers;
}

    [System.Serializable]

    [IncludeInSettings(true)]
        public class Syllable {
        public List<NeemUnitContainer> Syllables;
}

    [System.Serializable]
 
    [IncludeInSettings(true)]
    public class NeemUnit {
        [SerializeField]
        public List<FlexNeem> individualNeem;
         
    }

    [System.Serializable]
 
    [IncludeInSettings(true)]
    public class FlexNeem{
        [SerializeField]
        public NeemData superNeem;
     
        [SerializeField]
        public FeemData Feem;
 
    }

    [System.Serializable]
 
    [IncludeInSettings(true)]
    public class CompleteWordList{         
            public List<Syllable> completeWord;
    }
    public List<CompleteWordList> allWords;

}

It’s working great, but when I pull data from the Scriptable Objects into variables… I can’t see them in the Inspector.

This is making debugging much harder. Any tips on how to structure my Scriptable Object to make this data viewable in the Inspector? Thank you!!

What does your class definition look like? I’m pretty sure you’re supposed to use [Serializable] at the class definition, not when you declare the variables.

I have most of the Class definitions in the posted Scriptable Object?

There are 2 classes referenced that are defined in other Scriptable Objects:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Audio;

[CreateAssetMenu(fileName = "New NeemData", menuName = "Neem Data", order = 51)]

public class NeemData : ScriptableObject
{
    [SerializeField]
    public string neemName;

    [SerializeField]
    public Vector3 neemPosition;

    [SerializeField]
    public Sprite singleNeemSprite;

    [SerializeField]
    public AudioClip Pronunciation;

    [SerializeField]
    public List<PronunciationData> blendPronunciation;

    [SerializeField]
    public string feemText;

    [SerializeField]
    public List<FeemData> coreFeems;

    [SerializeField]
    public Color feemColor;

}
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "New FeemData", menuName = "Feem Data", order = 51)]

public class FeemData : ScriptableObject
{
    [SerializeField]
    public string feemName;

    [SerializeField]
    public string Neem;

    [SerializeField]
    public Int32 neemNumber;

    [SerializeField]
    public string coreGrapheme;

    [SerializeField]
    public string shadowString;

}

Again, the [Serializable] attribute is for class definitions. You want to put it above where you wrote your class code.

Also, this does not look like the normal inspector, are you using a different one?

1. Again, the [Serializable] attribute is for class definitions. You want to put it above where you wrote your class code.

I’m able to see the NeemData and FeemData in the Inspector all right.

The problem is with the WordPronunciationData Scriptable Object… those classes aren’t showing up in the Inspector.

2. Also, this does not look like the normal inspector, are you using a different one?

It’s just the normal Inspector.

But just to clarify, I am not viewing the Scriptable Object directly in the Inspector… but when I set a variable equal to the Scriptable Object, that’s how it’s showing up in the Inspector (or not, as it were).

I just can’t see the data in my Scene variables, it just says “No Inspector For”… and then lists the specific class it can’t show me in the Inspector (just like in the screenshot).

Where are you pulling the variables into? I can see the ScriptableObject just fine in my Inspector, and it doesn’t really look like yours.

8342181--1097154--upload_2022-8-6_11-58-51.png

And then the normal inspector of a variable equal to the ScriptableObject

8342181--1097157--upload_2022-8-6_12-0-5.png

I will note that I do not have Unity.VisualScripting, and also removed the [IncludeInSettings(true)] attributes, as I did not have the packages installed.

1. I will note that I do not have Unity.VisualScripting

Ah ok… I’m referring to the Graph Inspector for the Visual Scripting. That’s where the first screenshot is from…

2. I can see the ScriptableObject just fine in my Inspector, and it doesn’t really look like yours.

I can also see the ScriptableObject just fine in my Inspector as well!

I mean that when I set a variable equal to a part of the Scriptable Object, I can’t see it in in my Graph Inspector…

I’m assuming this might be a Visual Scripting related problem somehow, and would suggest posting this on their dedicated forum instead if it is. Here’s a link to them. Sorry for the confusion.