Question by
yashgarg2809 · Apr 19, 2020 at 07:45 PM ·
game development
My programs Just runs once(Creating SimonGame)
Okay,So I am new to unity. I was trying to develop a simon game. But the problem is my code runs only once.Here is my code.. Please tell what is problem here...
while (i < n)
{
i += 1;
red_1.SetActive(false);
purple_1.SetActive(false);
green_1.SetActive(false);
orange_1.SetActive(false);
red.SetActive(true);
green.SetActive(true);
orange.SetActive(true);
purple.SetActive(true);
randNum = Random.Range(1, 5);
if (randNum == 1)
{
red.SetActive(false);
Invoke("nothing", 01);
red_1.SetActive(true);
}
if (randNum == 2)
{
orange.SetActive(false);
Invoke("nothing", 1);
orange_1.SetActive(true);
}
if (randNum == 3)
{
green.SetActive(false);
Invoke("nothing", 1);
green_1.SetActive(true);
}
if (randNum == 4)
{
purple.SetActive(false);
Invoke("nothing", 1);
purple_1.SetActive(true);
}
}
}
public void nothing()
{
}
Comment
Your answer
Follow this Question
Related Questions
Game editor lag 0 Answers
How to create a checkerbox material or texture with containing two textures? 0 Answers
Multiplayer First Person Game 0 Answers
Game crashes on iPhone 11 0 Answers