Unity 5.2.1 not responding after hitting Play
Unity stops working every time I hit "play". When I hit it, the loading symbol that comes up on a Mac appears, but it never goes away, and it says that Unity is not responding. I then have to Force Quit Unity in order to load the same project or another one.
Does it do this on a new project with no changes? Or just in your project? If it's the latter then you probably have an infinite loop in your code.
It is just my project, and I was commenting out some code, and now it is working. That must have been the problem, thanks!
I suggest you to take a look at the Unity Editor log it might help you find the issue.
Answer by d3garcia · Jun 30, 2016 at 05:05 AM
So I just got this exact same issue today running on macOS El Capitan and Unity 5.3.5f1. I tried different work around, I commented all my scripts by using / / on the entire script but no luck, I even tried deleting Unity's "com.unity3d.UnityEditor5.x.plist" actually I had three UnityEditor plists and I deleted them all, again, no luck, so I decided to delete object by object and hit play until BAM! one of the objects was causing the issue because I created a new folder and moved all the object's sprites to this new folder. I have a public sprite variable in the script so I can drag the sprite in it, so when I tried to select the sprite by clicking the little circle at the right of the variable name in the inspector Unity got stuck again, so what I did is I went to the folder containing the project then the folder for those assets (sprites), I deleted them, ran again Unity and tried the project with no issue, so I imported the sprites again, reassigned them to the script and problem solved! Hope this helps and was not to confusing.
Answer by Tyzar-Zither · Jul 11, 2016 at 10:54 AM
Your commented script must be source of error. There are many possibilites on that line of code like stack overflow caused by infinite recurssive call,etc.
Mostly, i found this issue caused by stack overflow at my code..
Hope this help you at the future.