Play mode taking insanely long.

Hi,

So this is a weird one, it’s a little intermittent and the length of time varies. Sometimes it takes 30 seconds, other times it can take upwards of 5 minutes. It does seem to be slowly getting progressively worse, it used to be consistently like 20-30 seconds but it’s now on average 2-3 minutes. We’ve also had an instance where it took a good 16 minutes before I had to kill it with task manager.

I’ve profiled it and it’s showing SpiteAtlasManager.OnEnterPlayModePreAwake-> Write asset changes to disk as the culprit. We don’t use sprites in our project other than the UI but this seems to happen even on scenes with no UI.

We also have no references to it in the code;
6954233--818450--spriteAtlas2.png

The project is on an SSD (adata pro 1TB), the C:\ is also an SSD (Samsung Pro 970 M.2) and unity is installed on the C:. I have deleted my library folder but it still persists and reimporting all doesn’t seem to fix the issue either…

Unity 2020.2.6f1 ( but we’ve had the issue since Unity 2019 ).

Not sure if anyone has seen this before? Any suggestions on what to do? It’s driving me insane.

The only option I know about Sprite Packer is Project Settings > Editor > Sprite Packer. Maybe changing that value helps. Another shot is to create an empty project and copy Assets to new empty project to check if issue persist.

2 Likes

Unsure of whether it’s a permanent fix but I switched it to “Sprite Packer V1 - Builds only” and playmode was instant! Hoping it’s sorted. Appreciate that, thanks!

1 Like

Hey @zakdank_1 ,

Does this still happen? If you can you repro this problem AND supply a native stack trace?
I put together a guide on how to do that here: Debugging Editor freezes and hangs [Windows Only]
If the editor is stuck a long time doing something, and there’s no good info from the profiler, the native stack trace could help us figure out if it is indeed a mutex or something else that’s taking a really long time.