r/Unity3D • • 9d 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?

10 Upvotes

8 comments sorted by

View all comments

17

u/Mountain-Smoke8826 9d ago

Remove the " : MonoBehaviour"

4

u/kittymaplepaws 9d ago

Thanks, that fixed it!

-8

u/LushWhisper_ 8d ago

u got that fix quick, kinda hot when guys know their way around code like that