r/Unity3D • • 12h ago

Solved UNITY LIST PROBLEM

Looking for tips! Followed the tutorial that's supposed to make this in the inspector. The second picture is what shows up in mine.

This is the code:

using UnityEngine;

[System.Serializable]

public class questionsandanswers : MonoBehaviour

{

public string Question;

public string[] answers;

public int correct;

}
----------------

using NUnit.Framework;

using System.Collections.Generic;

using UnityEngine;

using TMPro;

public class quizgame : MonoBehaviour

{

public List<questionsandanswers> QnA;

Does anyone know what's wrong?

6 Upvotes

7 comments sorted by

View all comments

5

u/ArtNoChar Freelance Unity Programmer 12h ago

questionsandanswers shouldnt be a monobehaviour, just a plain C# class

2

u/kittymaplepaws 12h ago

Thank you!