Unity v2022.2.1f1
Spine v4.1
Timeline v1.7.4
While I was working on Spine animation in Timelines I noticed that the editor preview was broken.
The skeleton behave like you try to play an animation on a higher track index but there are already animated keys on a lower track.
I figured out that this was caused by the base animation of the SkeletonAnimation component. Everything works fine if the "Animation name" is set to None in the editor but once you set an animation on that field, it produces what I described above.
I searched for a bit to find where was the issue but couldn't find out. Is there something I can do to fix that ?
Conflict between Timeline and SkeletonAnimation base animation
Here are all the packages relative to Spine I am currently using
Are those versions up to date ? I followed the online documentation but I may have forgot something ?
- Modifié
Midonk That's unfortunate, sorry to hear. Does this issue only occur on a single skeleton asset? Or did you encounter this problem with multiple assets? If it only occurs at a single asset, you could try whether re-importing the respective skeleton asset directory perhaps resolves your issue. If re-importing does not fix it, you could delete the generated SkeletonDataAsset
, however be sure to first back-up the .meta file and then copy it back into the old location so that you don't lose any references to it. As usual, before deleting anything from your project, back up your whole project to be on the safe side.
Another standard way would be to delete the Library
directory and see whether this resolves any problematic incorrect state in the Unity project.
@Harald The issue occurs on every skeleton I can import. I tried to reimport skeleton, deleted SkeletonDataAsset
, deleted Library
folder, none of those worked. I don't understand. The only knowledges I have are about the symptoms, like the default animation would be on some kind of "layer -1" overriding above animation keys
Midonk Sorry to hear. Then you could have a try creating a copy of your problematic project and step-by-step replacing parts of it with the respective files of a fresh project. For example you could copy the whole ProjectSettings
folder over from the fresh project, check if it changes anything, then copy the whole Spine
package content over (best first delete the previous Spine
package files), and so on.
You could also go the other way around, and start with the fresh project and then overwrite its content with the files from your problematic project.
Harald Okay, I succeeded to reproduce the problem from a fresh project. Here are the steps to reproduce:
- From Unity hub, create a new Unity project (v2022.2.1f1 URP 2D)
- Install those packages (currently last versions)
- import a spine model (with at least one animation, I tested translates, rotates and scales transformations, all of them produces the issue)
- In a scene, add a GameObject with a
PlayableDirector
- add the model to the scene as an
SkeletonAnimation
- set an animation in the field "Animation Name" of the
SkeletonAnimation
- Create a
TimelineAsset
with aSpineAnimationStateTrack
with the same animation than theSkeletonAnimation
on this track - Reference the
TimelineAsset
in thePlayableDirector
on the scene - Bind the track to the
SkeletonAnimation
on the scene - Start the preview of the timeline
Sometimes the preview works on the first play. In this case, enter play mode en once you will exit it, start the preview again, the animation should not play properly as all the keys are the same as the "Animation Name" but this also happens with different animation with keys on the same bone and transformation.
I hope you will be able to reproduce this way.
@Midonk Thanks for the reproduction steps, we were now able to reproduce the issue. I first assumed that by skeleton preview you mean the Preview panel in the Inspector of the SkeletonDataAsset.
We have just pushed a bugfix to both 4.1 and 4.2-beta branches, affecting both the spine-unity runtime as well as the Spine Timeline UPM package. Please be sure to update both packages accordingly.
The packages are available for download here as usual:
https://esotericsoftware.com/spine-unity-download
Please let us know if this resolves the issue for you as well. Thanks for reporting!
Issue ticket URL for later reference:
EsotericSoftware/spine-runtimes2307