• Editor
  • Garbage Collection Issue in Unity3d

Related Discussions
...

Hello,

I am starting to use Spine with Unity3D and I love it, but I'm running into an issue.

I have about twenty characters looping the same animation, but in the profiler GC.Collect() in SkeletonRenderer.LateUpdate() causes a number of spikes and noticeable stuttering.

I set the animations only at the beginning, and I don't instantiate anything, and each mesh consists of one material. Everything looks normal aside from the fact that animations are scaled to 0.01, but I doubt this has anything to do with it.

I've attached some pictures to help identify what I'm working with here.

Any tips or thoughts on how to improve my performance? If I could spread the collecting over several frames or eliminate it altogether (why aren't animations pooled?) it would be grand.

Thanks.

What version of unity?

Mitch wrote

What version of unity

4.5.5


Any help is appreciated...


Issue fixed by editing the code in SkeletonRenderer.LateUpdate(). Basically I removed every instance where a variable was declared and used global variables instead.

I was starting to go thru the same process but I was trying to isolate what was actually causing GC Collect to fire and couldn't find it. If you could email me an example project with the issue I'd love to prod at it.