Hello, guys!

I have a problem when using Spine animations on Unity. In this case, it is a SkeletonGraphic, but the problem is the same for skeletonAnimation.

I tried to find a solution myself, but after trying for three hours, I didn't find the solution. The problem is the transition between an animation parpadeo/bajo, let's say A, to parpadeo/normal, let's name it B.

The transition works well when I go from B to A, but when I go from A to B, it doesn't show any transition. When I use the Spine preview, everything goes well, but not on Unity. Another character (Rin) works well with the transition, whether it's A to B or B to A, and I'm using the same code to change the animations:
v_animationState.SetAnimation(p_track, p_nombre, true);

I noticed this problem happens to my character, Rex (and another three NPCs), only when his eyes open, not when they close.

At first, I used different ways to do those animations for each Spine object, but even after animating Rex the same way Rin is animated, Rex's blinking still does not work well during the transition.

Rex:

Rin:

    Related Discussions
    ...

    It seems like you're experiencing issues with animation transitions in Unity using Spine animations, specifically with the transition from animation A to B not working as expected for your character Rex. This issue might be related to how the animations are set up or exported. One potential cause could be missing or incorrect keys in the animations, especially if the transition works in the Spine preview but not in Unity. You might want to check if the animations for Rex have the necessary keys set up correctly, similar to how they are for Rin. Additionally, ensure that the animations are exported with the correct settings, such as not having the "Animation clean up" option enabled if it removes necessary keys. If the problem persists, consider reviewing the setup of the animations in the Spine editor and comparing them with the working setup for Rin.

    GuapoMan Based on your description, it seems likely that there is a problem with the way the animation is created. Without seeing how the keys are set, it would be difficult to identify the cause. Could you please email us the Spine project in which the problem occurs?: contact@esotericsoftware.com
    Please include the URL of this forum thread in the email so we know the context. Then we can take a look at what's wrong.

      Misaki Thanks for your answer! Actually, the bot's answer worked! But I think someone deleted that answer.

      Disabling the 'Animation clean up' option inside the Export feature fixed the problem. It seems that having that option enabled deleted the initial keys of my animations, affecting the transition.

        Nate That's true! But I would need to check that option for all my animations, so in my case, it is better just to disable the 'Animation clean up' option.

        GuapoMan I deleted Spinebot's answer because, while using the SkeletonMecanim component requires additional keys at the first frame when instantiating the skeleton, you mentioned that the same issue also occurs with the SkeletonGraphic or SkeletonAnimation components. That led me to suspect that the problem might lie in the animation itself, so I thought it would be helpful to identify which timeline was causing the issue.

        As the Spine User Guide (link provided by Nate) explains, whether an initial key is required for animations depends on how the animations are layered. I hope the user guide helped you understand the issue. If you have any questions in the future, please send us the Spine project so we can identify the cause.

          Misaki Yes, thanks! I read it too, and in my case, I need the first keys of my animations because the blinking takes more than one second to happen, and if the animations don't have the initial keys, the transition doesn't happen well.

          The issue with the animation clean-up was that my first key was nearly identical to the start of the blinking, occurring a few seconds later. As a result, the clean-up removed the first key, causing the transition to function incorrectly.

          And yes, I could use the Layered option as Nate said, but I find it easier to disable the general option than activate the Layered option in every animation.

            GuapoMan I’m glad to hear you've figured it out! Thank you for getting back to us. 🙂

              Misaki Thanks to you, guys! I'm glad to have such a fantastic forum! You always help me solve my issues very quickly!