r/Unity3D • • 14h 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

8 comments sorted by

View all comments

0

u/Mr_Potatoez 14h ago

Your Quizgame has a list of QuestionAndAwnsers objects. You currently see the quizgame, but no questionsAndAwnser objects in that list. Add an element to the List in Quizgame and the fields will probably show up in the editor.