Tons of errors

I get a like 10 errors from entering the for int portion of code. AM i missing a core plugin for this?

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using TMPro;

public class Quiz : MonoBehaviour

{

[SerializeField] TextMeshProUGUI questionText;

[SerializeField] QuestionSO question;

[SerializeField] GameObject[] answerButtons;

void Start()

{

    questionText.text = question.GetQuestion();

}

{    

    for (int i = 0; i < answerButtons.Length; i++)

    {

        TextMeshProUGUI buttonText = answerButtons[i].GetComponentInChildren<TextMeshProUGUI>();

        buttonText.text = question.GetAnswer(i);

    }

 

}

}

Assets\Scripts\Quiz.cs(18,5): error CS1519: Invalid token ‘{’ in class, record, struct, or interface member declaration

Assets\Scripts\Quiz.cs(19,20): error CS8124: Tuple must contain at least two elements.

Assets\Scripts\Quiz.cs(19,20): error CS1026: ) expected

Assets\Scripts\Quiz.cs(19,20): error CS1519: Invalid token ‘=’ in class, record, struct, or interface member declaration

Assets\Scripts\Quiz.cs(19,49): error CS1003: Syntax error, ‘>’ expected

Assets\Scripts\Quiz.cs(19,49): error CS1519: Invalid token ‘;’ in class, record, struct, or interface member declaration

sets\Scripts\Quiz.cs(19,52): error CS1519: Invalid token ‘++’ in class, record, struct, or interface member declaration

At a guess you’re missing a method name directly following the Start() method.

Hi,

Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture? Make sure that all curly brackets are at the correct position.


See also:

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

Privacy & Terms