Help! When I try to start a game I am working on, my unity editor just stops running, I can’t interact with the screen, and I can’t close unity. I am forced to open task manager and close unity editor. I have tried restarting unity, changing settings and nothing is working. Please Help!
Unity Version: 2020.1.17f1
Specs:
Windows 7 - 64bit
Processor: i7 7700k
Ram: 32Gb
Graphics card: Nvidia Geforce Titan Xp
A freeze in play mode is almost always caused by an infinite loop in your code. Check all the loops in your code you’ve made changes to since the last time you entered play mode successfully.
Your game shares the same main thread with the rest of the Editor. If your code gets stuck in an infinite loop the Editor becomes unresponsive, because it is waiting for the current frame to end to respond to your input. It waits forever because the frame is never allowed to end.
You can also attach the Visual Studio debugger while it has frozen, and click the pause button to pause execution. It should stop on a line located in the infinite loop.