• RuntimesUnity
  • Seamless Transition of Transform Constraint in Unity

For animations A and B where the transform constraint value changes within the animation, when transitioning from A to B in Unity, is it possible to make the transform constraint value transition seamlessly?

In Spine, the transition is seamless, but in Unity, only the transform constraint does not seem to transition seamlessly (after mix time, it seems to transition from the transform constraint value of A all at once) (other bones etc. transition seamlessly).

I would appreciate it if you could provide some guidance. Thank you.

Related Discussions
...

Which exact version (including the date) of the spine-unity runtime are you using? It's the name of the unitypackage, also listed in Assets/Spine/version.txt, or alternatively the version displayed in the Unity Package Manager window.

If you're not using the latest spine-unity runtime package, please have a try whether updating resolves the issue (as always, create a backup of your project first).

If the problem persists with the latest package version, could you please send us a minimal Unity project which still shows this issue? You can send it as a zip file to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context.

Thank you. I have sent ”contact@esotericsoftware.com” the zip file of the project as I have updated it below and it did not resolve the issue. Thank you for your patience and please check it.

Package version: spine-unity-4.1-2023-10-06.unitypackage
This Spine-Unity runtime works with data exported from Spine Editor version: 4.1.xx

@moti Thanks for sending the reproduction Unity project. While the project is more complex than it needs to be for reproduction, we could reproduce the issue you are having. We will have a look at what's going wrong and get back to you here on the forum once we've figured it out. Please for the future simplify your skeleton by removing any unnecessary constraints (your project contains 38 constraints!), bones and attachments which are not required to show the issue.

@moti The problem seems to be that animation B has the first key (of the constraint Rotate Mix value) not at the first frame but later at frame 54. To fix the issue, please add a key at the first frame by copying the key from frame 54 to frame 0.

When playing animation A and then B on track 0, any time before the first key is using the setup pose value since no lower track exists, which makes the transition look smooth on track 0. When played on track 1 however, the behaviour is defined as not performing any change before the first key, thus unfortunately no mixing happens and the animation A value of e.g. 1.0 is held until the end of the transition, then suddenly when reaching frame 54 the value 0.3 is applied, wich is both too late and is also happening without a transition.

Thank you very much for your assistance. It does indeed seem like the animationB is behaving as if I had set a key on frame 54 without placing one on frame 0.
In my understanding, I believe that setting a key on frame 0 will resolve the issue. However, animation B already has the same key (of the constraint Rotate Mix value) as frame 54 at frame 0 in the project I sent you.

  • Harald ответили на это сообщение.

    moti However, animation B already has the same key (of the constraint Rotate Mix value) as frame 54 at frame 0 in the project I sent you.

    The exported SpineTransformConstraintToUnity.json skeleton file does not contain the key at animation B on frame 0. If you placed one there, did you perhaps export with Animation clean up enabled? If so, please disable this setting when using multiple tracks, as it it removes keys identical to the setup pose.

    If you mean that the animation B looks and behaves as if there was a key on frame 0 in the Spine Editor: this is because the setup pose (with value 0.3, or 30%) is used as a base value before your animation is applied on top, and your animation later on frame 54 sets the same value (also value 0.3) as the setup pose. Therefore the problem just surfaces when the animation is layered on top of an animation which does not set the value to 0.3.

    If I misunderstood your question, could you please explain it in more detail or in different words?

    Disabling "Animation clean up" resolved the issue. The problem was caused by having "Animation clean up" enabled in the output.

    I truly appreciate your help, especially considering your busy schedule. Thank you very much.

    • Harald ответили на это сообщение.
    • Harald оценил это.

      moti Glad to hear it helped, thanks for getting back to us!

      • moti оценил это.