- Bearbeitet
BUG - Inconsistencies in animation playing
Hello,
I am facing inconsistencies in animation playing between the Editor and Unity.
In the following example, we have a character with two tracks. The base track is always looping the Idle animation, above it is an animation of holding a sword.
When a key is pressed, the upper track plays a Sword Hit animation, and then goes back to Holding.
As shown in the videos, the Unity runtime has glitches after the Hit animation that are not apparent in the Spine Editor (videos are at 20% time scale):
https://streamable.com/af38gz
https://streamable.com/k54x4j
Spine file:
https://we.tl/t-stzQF8klsn
Here is the code:
private void Start ()
{
spine.AnimationState.SetAnimation(0, "Idle/E", true);
spine.AnimationState.SetAnimation(1, "Hold/E", true);
}
private void Update ()
{
if ( Input.GetKeyDown(KeyCode.Space) )
{
spine.AnimationState.SetAnimation(1, "Hit/E", false);
spine.AnimationState.AddAnimation(1, "Hold/E", true, 0);
}
}
Thank you,
Danielle
This is likely the same problem that has been fixed recently, here:
https://github.com/EsotericSoftware/spine-editor/issues/545
It has been fixed in spine-libgdx and will be ported to other runtimes very soon. Sorry you ran into trouble with it before we got it fixed in all the runtimes!
Thank you! I shall wait, hoping it will fix the issue
The bugfix has been released for the spine-unity runtime as well now.
The updated 3.8 unitypackage can be downloaded here as usual:
Spine Unity Download