- Home /
Unity Freezes Every Few Seconds
While Visual Studio is running, Unity freezes over time.

Even if I am just right-clicking and dragging the mouse, it periodically stops for about 2 seconds. Over time, the time to stop becomes longer and the term that occurs becomes shorter.
I don't know what the reason is. Do you know the solution?
Answer by Odinwastaken · Oct 15, 2020 at 09:20 AM
Well you can see that it is not the scripts, rendering or anything like that, its under "other" which is using all your cpu. I'm also quite new to unity and I'm not sure if this cpu usage includes the whole pc's usage or just unity's if the whole pc's it maybe something do with a program you are running in the background. If this is not the answer, try make a new project and see if the lag carries over.
Other programs running in the background are irrelevant. Likewise, if the script is loaded into VisualStudio for a new project, this happens after a long time. It all happens from Unity version 2018 to 2020.
As a temporary solution, relaunch Unity or This is improved by unloading VisualStudio and making changes to the scene in Unity. But you can't always do this.
Answer by RMB1100 · Jul 14, 2021 at 09:01 PM
Possible solution: I had this same problem - on playing the scene in the editor, it would run for around 7 seconds, then freeze/lock for about 5 seconds, then repeat this cycle. The culprit for me was Sophos antivirus software. If disabled, Unity ran normally without freezing. I was so relieved to have found the problem I haven't investigated why this is happening, but my best guess is the record files (simple text files) I'm writing to are being scanned as they update and this is holding things up.
Your answer
Follow this Question
Related Questions
Need help with audio files causing unity to freeze 0 Answers
Unity Keeps Freezing on Play (Again!) 1 Answer
,Storing Vector3 arrays in another array? 1 Answer
built game freezing 1 Answer
This Map Generator is freezing unity 1 Answer