Not able to edit Dialogue SO in editor

Unity v 2021.3.5f1:
I have followed the code perfectly, but instead of being able to edit the ID, text, and children… I am just showing “None (Dialogue Node)” for each element. I mean I sort of see where Unity is going with that… I am going to see if when we get the editor going it works just fine, but I wanted to at least point out that it is happening to me.

I believe the problem is that your DialogueNode is a MonoBehaviour instead of a simple class…
At this point in the course, DialogueNode should look like this:

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

[System.Serializable]
public class DialogueNode //Note:  No :MonoBehaviour here.  
{
    public string uniqueID;
    public string text;
    public string[] children;
}

If it’s a MonoBehaviour, then the inspector can’t show it in the inspector (in fact, a MonoBehaviour can’t even exist unless attached to a GameObject, so a list of MonoBehaviours can really only be a list of GameObjects or prefabs with MonoBehaviours attached.

1 Like

Well poop, Brian… You nailed it… Can’t believe I missed that.

That’s the price I pay for having a WFH day job that I work crazy nighttime hours but my position allows me to not have to do much actual work so I do stuff in Unity while I work… :joy:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms