- Home /
The question is answered, right answer was accepted
Unity is really slow when selecting.
Hi everyone!
The Problem:
I've been working on a game for several years now, and unity seems like a really stable and well build engine. - I've run into very few errors that I couldn't solve, some time ago (Probably about a month) Unity started to get pretty slow. The editor runs smoothly enough, and I achieve normal framerates in my game, but whenever I select something in the editor, like a object in the scene or hierarchy, A asset in the Project tab, or opens up the Input settings everything freezes for about 5 seconds.
This is obviously really annoying, and I really hope that someone knows how to fix it. I have found no solutions on the internet though, and I also haven't found any myself. I have found though, from profiling the editor that "EditorApplication.Internal_CallUpdateFunctions" is what takes up 99,7 percent of the performance in that frame. This is categorized as garbage collection by unity.
It's worth noting that this happens in any scene in that project, even an empty one. Also note that this only happens in this project.
What I've tried
Copy the project to a different directory
Reimport all assets
Reorganize both the hierarchy and project window (Not likely to fix the problem, but it had to be done anyway)
Close all tabs except the project tab
Advance profile the editor to see what specific functions are called (Advance profiling doesn't even pick up the 5 second freeze)
I really hope that my issue can be resolved. None the less Thank you. :)
Edit:
I forgot to mention, that if I select an object, then deselect it, and then select it again the selection happens immediately.
Does your project contain any editor scripts which might cause this slowdown? How many objects are in the scene and how many assets are in the project (just the order of magnitude)?
Internal_CallUpdateFunctions sounds like you have a poorly written editor script which does heavy stuff inside the update delegate. The 5 second freeze might be related to heavy stuff inside a OnSelectionChanged / OnHierachyChanged callbacks.
Thank you very much for the fast respond on your end, and sorry for the late response on my end.
From further research it appears that you are right, and the problem, at least by the looks of things, are related to editor scripts; If there are any compiler errors the selection works fine.
I do have a lot of editor scripts, since I write one for almost every script to keep the inspector GUI nice and user friendly, so it may take a while to locate the exact problem.
Anyways: Thank you for pointing me in the right direction :)
Hi, do you know where the problem was? I too am selecting from scene where I have many objects, and it makes lag for about 10+ seconds....
Follow this Question
Related Questions
Unity Editor freezes after exiting playmode 2 Answers
How can I create a editor button that can not be selected 0 Answers
How do I set the current script as the selection in the project view? 1 Answer
Editor crashes on play 0 Answers
Spline Editor: Maintain object selection and object attachments 0 Answers