• Editor
  • [PLZ HELP!]Some problem merging spine animation in COCOS Cre

We created bunch of animations with Spine 3.5.51 and imported to cocos creator.

Animations got no problem when played one by one in cocos.

After we tried merging animations using trackIndex, things got weird.

It feels like some animations was shown on top and never switch back once we turn around (or play a animation showing characters back) , but every animation showing the front of the characters seems fine.

I wonder is there some specific rule of spine animation making that I failed to realize?
Can anyone help us? We're devastated. 😢
Here's a link to the original spine file.

Related Discussions
...
  • Đã chỉnh sửa

It's hard to tell what might be going wrong in cocos. 3.5.51 is quite old, more than 4 years ago. It could be there is a bug with how AnimationState is applying animations, or it could be the runtimes are so old that they are before we changed how animations are applied (I just explained it minutes ago, here). Can you use the 3.8 or 4.0 runtimes?

Nate đã viết

It's hard to tell what might be going wrong in cocos. 3.5.51 is quite old, more than 4 years ago. It could be there is a bug with how AnimationState is applying animations, or it could be the runtimes are so old that they are before we changed how animations are applied (I just explained it minutes ago, here). Can you use the 3.8 or 4.0 runtimes?

Nate thank u for your reply.
We are using older version of cocos that doesnt support spine animation higher version.

And I found out that the problem was not caused by bug. it was caused by some "draw order keys" or "show&hide slots keys" at the end of some animation.

Like the picture attached down below, if I hide my face,eyes,eyelashes and eye skins at the first frame when I'm animating a back animation, should I reveal them at the end? Because if I dont, these image will be missing when I turn my character from back to front.

So my question is is there a rule if we should reveal these hidden image at the end frame if we want to use trackIndex to merge animations in cocos?

Sorry for the delayed response.

Did you see my description in the post I linked? Likely the 3.5 runtimes are before we improved how animations are applied.

In old runtimes, the changes that animations make to the skeleton persist, even after that animation is no longer applied. To fix this there are three options:
1) Use newer runtimes. This is ideal, but I understand may not be an option for you.
2) Set keys at the start of all animations for everything any animation keys. This ensures that any changes from a previous animation are reset when a different animation is applied. This is only needed for animations run on the lowest track: the lowest track animation resets all the state of the skeleton, then higher tracks are applied on top of that. This option is suboptimal because it requires a lot more keys. It is also a bit tedious and error prone, as you can easily forget to key something.
3) Every frame (or whenever you change an animation), you can reset the skeleton state before applying animations, for example by calling Skeleton setToSetupPose.

Nate đã viết

Nate thank you again for your reply.

These options are very helpful and we are using your second option now.

Lot of key organizing I need to check but it will do.

Unfortunately we can't switch to higher spine version but at least we have a solution and it works.

Thank you again Nate 🙂 We really appreciate your help! 😃

Glad that is working for you! Hopefully you can use the latest runtimes next time, it's a lot easier. 🙂