• Unity
  • Weird track mixing issues

I have never had issues with this before, but all of a sudden, something that looks great inside Spine, looks very weird in Unity.

Track 0 = Idle animation
Track 1 = Hold Item animation (pulls out hand)

Now in Unity I set this using this simple code

var trackEntry = skeletonAnimation.state.SetAnimation(1, spineAnimationCached, false);
trackEntry.MixDuration = 0.3f; // Duration of mix

I have a toggle method, that switches between this and an empty animation.

The first time it just jerks into position. But the position looks ok. When i clear it, it animates smoothly back into the idle pose.
Then second time i enable it, it smoothly animates, but not to the full pose, if you check the video, the hold item animation isn't the same as first time. After that, it repeats the same smooth on/off into the wrong pose.

Any idea what's going on here?

I also tried additive mixing, which looks almost the same in Spine, but this makes it totally freak out in Unity, with arms spinning around.

Also another weird thing is that in Spine, the hand looks rotated in the mix, but it looks ok in Unity.

In the export, I have non-eseential data checked, and animation cleanup disabled. I'm using Spine 4.0 export format, exported from 4.0.17.

This is what it looks like in Spine, with and without additive:

Related Discussions
...
  • 編集済み
nicmar wrote

The first time it just jerks into position. But the position looks ok. When i clear it, it animates smoothly back into the idle pose.
Then second time i enable it, it smoothly animates, but not to the full pose, if you check the video, the hold item animation isn't the same as first time. After that, it repeats the same smooth on/off into the wrong pose.

Any idea what's going on here?

Unfortunately I can't tell without additional context info.

nicmar wrote

I also tried additive mixing, which looks almost the same in Spine, but this makes it totally freak out in Unity, with arms spinning around.

Quoting Nate's posting here:
"The important thing about applying additively is that all properties keyed by the additive animation must be either set in lower tracks or set in code. Otherwise the value will be added to every frame, resulting in values that quickly get very large."

nicmar wrote

Also another weird thing is that in Spine, the hand looks rotated in the mix, but it looks ok in Unity.

Are you using an additive animation track here?

Currently the Spine Editor Preview window differs in how layered animations are displayed, since it calls setToSetupPose which is not called by runtimes. You can see a more detailed description in this issue ticket here:
https://github.com/EsotericSoftware/spine-editor/issues/547#issuecomment-606071406

If the above does not resolve your problems (and you are sure that you have Animation clean up disabled), could you please send us a minimal Unity project that still shows this problem? You can send it as a zip package to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know where it belongs to.

Thanks, i made a workaround for now, but if I get back to this later, i will set up a repro of it. Thanks again!

Glad to hear you've found a workaround.