This is probably a really simple question, can’t figure it out because I’m very new so any help would be appreciated
I want to run a while loop, and while my game object is spawned you can click it. But I’m not sure how to execute a while loop where the condition is a Boolean.
As soon as the chest is spawned and the chestSpawned == true, I get frozen in unity as its infinite. In 5 seconds the chestSpawned will return false but unity gets frozen before then so I’m not sure how to fix this.
Here is what I have.
while (chestSpawned == true)
{
Debug.Log ("Click the chest!!!");
}