I’m making a little quiz game with multiple choices for practicing. Each answer button has a random item taken from a string list. I mean, the list contains elements and with this script I “paste” a random string element from that list in the UI text box to show an answer:
public Text answerText;
[SerializeField]
private int randomAnswerIndex;
void Start () {
randomAnswerIndex = Random.Range(0, languageAnswers.Count);
answerText.text = languageAnswers[randomAnswerIndex];
}
Each answer button has this script referenced, but I’m lost in how to avoid that an item text from the list shows twice, i.e., the word “English” in two different buttons at the same time. How can I solve it? If it’s with an “if” statement, how can I access to the different button texts from the script? I’m trying to use “FindGameObjectWithTag”, but it doesn’t work.
Thanks!