Why unity crashes with my code ?
while (!gameDetails.serverLoaded)
{
BuildItAddon.BuildItAddon.ShowMessage("Can't join! the server is still loading! trying again!");
Thread.Sleep(3000);
}
while I have this lines in my code the game won't work. why ?
Comment
Best Answer
Answer by UsmanAbbasi · May 11, 2016 at 06:29 AM
Because this loop runs infinitely if server never get loaded which causes the unity to crash. Things like Infinite loops, infinite memory usage,etc crashes unity.