Ok, so, i try to make something like a quizz, where an array of strings has to be shown to the Text UI. Thing is, the question updates in the inspector after i answer it correctly, however it doensn’t on the game screen. Prob a noob mistake, sorry i’m newbie.
public string[] quesitons = new string[] { "2+2 = ?", "1+1 = ?", "3+3 = ?" };
public string[] answers = new string[] { "4", "2", "6" };
public int i = 0;
[SerializeField]
private InputField _input;
//Main
public string currentQ;
public string currentA;
public Text questionText;
public void GetInput(string input)
{
if (input == answers*)*
{
Debug.Log(“Correct”);
i++;
questionText.text = quesitons*;*
currentQ = quesitons*;*
currentA = answers*;*
}
else
{
Debug.Log(“Wrong”);
}
}
void Start()
{
currentQ = quesitons*;*
questionText.text = quesitons*;*
currentA = answers*;*
}
}
_*