• Unity
  • Playing and mixing animations using Unity Timelines issue

Hey,

I have a problem with playing and mixing animations using Unity Timelines.
I was looking into this problem for quite some time, but I cannot figure out what is going on.

I created a video that clearly shows a problem I'm experiencing. It was recorded without closing Unity in the meantime.
I start with idle animation and then play the second animation. You can look at one arm of our characters - sometimes the white cloth is appearing.

I performed 8 tests:
TEST 1 - the animation is played from code using SetAnimation() - ok!
TEST 2 - the animation is played from code using SetAnimation() - ok! (never seen any problems using SetAnimation())
TEST 3 - the animation is played using Unity Timelines - the white cloth is appearing - not ok!
TEST 4 - the animation is played using Unity Timelines - the white cloth is appearing - not ok!


ADDING A LINE OF CODE AND REFRESH


TEST 5 - the animation is played using Unity Timelines - the white cloth is not appearing - ok!
TEST 6 - the animation is played using Unity Timelines - the white cloth is not appearing - ok!
TEST 7 - the animation is played using Unity Timelines - the white cloth is appearing - not ok!
TEST 8 - the animation is played using Unity Timelines - the white cloth is appearing - not ok!

I cannot reproduce this. All I know is that after refreshing assembly for some time it is working ok, but for other people using Unity (e.g. animators), it seems totally random.
I was looking into the Spine Unity Timelines code, but I cannot see any big differences between playing animation from Unity Timelines and from SetAnimation().
This is killing me... :tear:
I'm debugging it for quite some time but without any progress.

Do you know where I should look for the solutions?

Thank you!

Related Discussions
...

Sorry to hear you're having troubles!

One guess is that it could be a problem related to Attachment Threshold (although in your specific timeline setup it does not look as if any transition is causing this)
TrackEntry attachmentThreshold
You could have a quick try if changing the Attachment Threshold parameter at the Timeline clip (to 0 or 1) changes anything. You could also check if changing the Mix Duration of your timeline clip has any effect on the issue.

If none of the above are fixing the issue, could you please send us a minimal Unity project that still shows the problem? You can send it as a zip package to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context. Then we can have a look at what's going wrong.

Hey Harald,

thank you for your information.
I checked both Attachment Threshold and Mix Duration and both did not change anything.

I started to create a clean minimal project for you, but when I finished everything works fine...
So I started to dig and finally found an issue.

In Unity we change Enter Play Mode Settings - we disable Reload Domain.

When Reload Domain is checked everything works fine. We disable reload because it significantly lower enter play mode time.
Of course each second saved is crucial for your team, so we'll need to fix it somehow 🙂

I send some links to Unity resources on Domain Reload topic:
https://docs.unity3d.com/Manual/DomainReloading.html
https://docs.unity3d.com/Manual/ConfigurableEnterPlayMode.html
https://docs.unity3d.com/Manual/ConfigurableEnterPlayModeDetails.html

Can you guide me on what should I look for the solution?

Thank you very much for your help 🙂

Thanks for the info and for narrowing down the problem. Also thanks for the documentation references, but we know about domain reload already. 🙂 Did you send us your reproduction project via email? Unfortunately we did not see any email related to this topic in our inbox.

Sorry, I thought that maybe after narrowing down the problem there will be an easy solution 🙂
I've just sent you the repro project.

9 dana kasnije

No problem at all, thanks for sending the repro project. 🙂 We will get back to you as soon as we've figured out what's going wrong and have a fix to offer.


We have finally found the cause of the issue. 8) Admittedly I overlooked the problematic line multiple times thinking that it's doing what it's supposed to do.

If you're curious: DataReloadHandler incorrectly reloaded SkeletonDataAssets but only re-initialized some of the scene's skeletons, leading to old and new Attachment object references being compared.

New 4.0 and 4.1-beta spine-unity packages have been released that contain the bugfix.
Spine Unity Download

The issue has been tracked under this issue ticket:
https://github.com/EsotericSoftware/spine-runtimes/issues/2066

Thanks again for reporting and for providing the reproduction package!


As the previous first commit did not fix the issue properly, we have just pushed a second commit and released 4.0 and 4.1-beta unitypackages. Packages are available for download here as usual:
Spine Unity Download

13 dana kasnije

I waited for a few days with the reply to test everything.
It seems to work.

Thank you very much! 🙂

Thanks for the feedback and the additional testing, much appreciated! 🙂