Hellos. Im having some serious issues here where I cannot diagnose what is wrong here.
Its been about 3 days of attempted fixes, ranging from re importing of assets, cleaning caches, to reinstalling a fresh project and re importing everything ‘fresh’.
I have no idea what to do now to fix this, but Unity freezes randomly, It could be at the play button. end of play mode to even closing the editor (exit) and it will freeze to where im forced to ‘task manager’ crash it. It doesnt show that its not responding, the editor just doesnt do anything and sit there. No action possible other than to crash it.
Can someone help me here figure this out? Where do I need to look, I saw somewhere about logs I can peek into to hopefully help with this problem.
Does this only happen for a particular project? It’s possible you have an infinite loop or deadlock in one of your editor scripts, or in an asset that you have downloaded.
One possible way to debug it would be to run with a debugger attached all the time. Then when the freeze happens, you can go to your debugger, hit Pause, then try to find the main thread and try to see what’s happening. View threads in the debugger - Visual Studio (Windows) | Microsoft Learn
Thanks, Ive tried something with VSCode (I hope I installed it correctly as it follows the general idea of the link you mentioned) and somehow NOW it chooses not to freeze but im sure it will eventually. Is there another way to help debug this freezing by the way? Would log searching help or another method as im quite unfamiliar with debuggers/attaching to process’s etc lol. Im learning though.
If the freeze is caused by an accidental infinite loop, it isn’t going to show in any log files unless you coincidentally are writing to the log in the loop. Chances are you aren’t. If you use types of loops which are prone to accidentally becoming an infinite loop, for example “while” loops, you might want to look at those.