I’ve create a list of GameObjects A to Z.
They’re then picked randomly and displayed on a 2D grid.
Next, I want to be able to tap the GameObjects in sequence A to Z.
How can I compare the list of GameObjects to know that the sequence is correct when tapped?
Originally I tagged each alphabet prefab as “A” to “Z”, but since I needed to count the length, I changed the tag to “Alphabets”. However, I now cannot destroy the object based on tag A - Z, and am trying to use the object name instead. It doesn’t seem to work.
Thank you.
void OnMouseDown()
{
GameObject[] alphabetCount;
alphabetCount = GameObject.FindGameObjectsWithTag("Alphabets");
if(alphabetCount.Length == 26){
if(this.object.name("A")){
{
Destroy (this.gameObject);
}
}
}
}