- Home /
HUGE Lag spikes in editor when playing an animation. Over 400ms GC.Collect (profiler screen included)
I'm trying to make a simple 1D Blend Tree, playing the animation in a single Inspector window.
After Unity restart, the problem does not exist, but after 20-30seconds, the lag spikes start to appear and soon the Editor is unusable when playing the Animation. See attached screen.
Any ideas?
Answer by sacredgeometry · Dec 05, 2020 at 09:13 PM
GC Collect is the garbage collector. Are you doing any linq or initialising and destructing of game objects/ classes?
If so I would suggest not and pooling your objects instead. Realistically you want to only to be destroying objects at opportunistic times i.e. when GC spikes aren't going to cause performance issues.
I am doing none of that in the editor.Simply playing the animation in the Inspector window. The game is not in Play $$anonymous$$ode. There are no in editor Scripts running. But you would know that if you looked at the screen or the description :)
Answer by ParametricAvocado · Jan 02, 2021 at 12:43 PM
I am having this same problem in Unity 2020.1.17f when any Generic or Humanoid animation, importer or transition is selected and displayed in the Inspector, no need for Blend Trees to be present, or for the Preview Drawer to be unfolded. I get the same ~400ms worth of GC Collection every 3-5 seconds even when the animation is not being played.