• Unity
  • Help!Some of my character’s animations are lagging in unity!

Related Discussions
...

Hi there, I could really use some help with one of my character. When I run two of the animations of the character in Unity, both of them show different degree of lagging; however, those two animations run perfectly fine in spine, no signs of any lag. Moreover, the character has five other animations (some of them are even more complicated), and they run perfectly fine in Unity. Only those two animations are showing different degree of lagging, and the FPS of those two animations have reached 15 FPS. The following images are the Profiler views while running a normal animation and a lagging animation. What causes the lag? What can I do to prevent the lag?


We need additional context information to help, please describe what makes the problematic animations different from other animations?

What does the setup of your character look like? Is it a single character or multiple?
From other threads I have seen that
a) you have modified the Spine-Unity runtime code - does the problem also occur without your modifications?
b) have been using SkeletonRenderSeparator to separate every body part to a single GameObject with Renderer - the latter will in general affect performance badly.

Does this problem also occur in simple setup, without any SkeletonRenderSeparator and when you set the initial animation (via Animation Name) to one of your problematic animations?

7 days later
Harald wrote

We need additional context information to help, please describe what makes the problematic animations different from other animations?

What does the setup of your character look like? Is it a single character or multiple?
From other threads I have seen that
a) you have modified the Spine-Unity runtime code - does the problem also occur without your modifications?
b) have been using SkeletonRenderSeparator to separate every body part to a single GameObject with Renderer - the latter will in general affect performance badly.

Does this problem also occur in simple setup, without any SkeletonRenderSeparator and when you set the initial animation (via Animation Name) to one of your problematic animations?

Yes, I have tried to create a new character without changing any of your codes, and also not adding any other scripts or other settings; However, when I set the default animation to the lagging animation in the inspector interface, the problem occurs. It shows that the FPS has reached 15 with only one character on the sense, and I tried to solve the lagging problem with this particular animation in many different ways, most of them didn’t work except when I reduced the slots for skinning on this character. I believe that I have got a preliminary solution so far. Now, with only one character on the sense playing the animation (the one used to lag), the FPS is higher than 60 which is good; However, when I have two characters on the sense playing it, the FPS will drop to 30 dramatically, and when I have more than three characters on the sense playing it, the FPS will drop to 14 or even worse. So, based on my description of the problem, do you have any other solutions other than reducing the slots for skinning on my character?

Could you please send us a zip package of your character assets to contact@esotericsoftware.com (if possible, both the exported files and the Spine project), then we can have an in-depth look.