Unity Editor Freeze

My team is having the worst time with an Editor freeze. Here is a video of what we are experiencing.

  1. Open Unity
  2. Press Play.
  3. You can see the window moves and everything is fine.
  4. Click away from Unity to the desktop.
  5. Click back to Unity it causes a refresh and the windows spinner comes up.
  6. You can no longer move Unity it is frozen.
  7. Bringing up the Task Manager shows Unity is barley using any resources, but is hung.

This started happening after we upgraded our project from Unity 4.5.5 to Unity 5.1.0. We have continued to see this issue from that point on. We are now on Unity 5.3.4 and the problem is still there.

I went through a painful process of removing plugins and assets until the project would not freeze. I never got a project that would actually run and not freeze. When removing assets we would think the problem was solved, but then it would just start happening again. I even tried rebuilding the project from scratch, but eventually Unity would start to freeze like this again. It’s such a random problem that happens a ton of times through out the day.

We also have tried attaching the debugger to the editor to see if any ‘ExecuteInEditMode’ scripts were running causing this hang, however the hang will never happen with the debugger attached.

This is not an issue that just happens on my computer it happens for everyone on our team. It happens on Windows 7, 8, and 10. Mac has slightly different behavior that usually ends with the editor crashing.

Our team is at a point where we have been dealing with this for about 1 year. We just are careful when making changes and just constantly restart Unity, but it does slow down development quite a bit. What else can we do to figure out what is causing this hang/crash?

Ok so the Windows unity is not getting built correctly there just slapping on features that are on Mac and putting it on Windows it is not built that well

Can anyone else help with this issue? We really need help getting this resolved. It feels like something someone from Unity would have to help with. Is buying Premium Support the only way to get this fixed for us?

Are you still having problems? If not, perhaps this might help someone else:

I started getting back into Unity development for about 8 hours a day back in July of 2015. Never had a editor freezing problem until last week when I started working on a threaded socket listener. Press play, everything runs fine, no errors. Go out of the editor, try to go back in - and it’s frozen. This goes on for days. So I open one of my other apps, in and out, run it, do stuff - absolutely zero problems. So I’m already thinking it’s not Unity. I do a search, come across this post perhaps you’re having a similar problem. Maybe this info will help:

Take a look at tanoshimi’s answer in this post:

Good luck!

Hey @lockbox we are having similar problems using a .dll that uses threads and sockets (made by us so we do have source). It all works when running test in visual studio but as soon as we use the dll from unity problems arise. If we try to run the project once in unity it works (although a lot slower than in visual studio). After running once we can’t run it again. We also can’t close unity or pretty much do antyhing that will lose context. I suspect there must be a thread or some resource that has not been let go properly but for the life of me I can’t find the issue…

If you found a solution or a good way to debug your problem please let me know!

I started playing with socket.io plugin in Unity and I’m seeing the same behavior - I can run the game once, unity freezes afterwards. Our game was building just fine before I added the socket.io plugin.
@Mikael-H Have you figured out what’s causing this?

1 Like

I managed to solve it, this helped Threading with UDPClient - Editor Freezing - Questions & Answers - Unity Discussions
make sure to thread.Abort() in OnApplicationQuit

1 Like

I had already made sure my own threads are both finished and joined :slight_smile:

We are using NetMQ and that was causing the issue. Seems like we are not the only ones who have been having problems.

Managed to fix it using the steps described in this thread : Unity get stuck · Issue #526 · zeromq/netmq · GitHub
For anyone else having similar issues note that at the the time of writing this, you need to download the latest commit of the master branch as opposed to the latest version on NuGet.