Ward

Hi,
My spine is not renderring at the right place.
Please check the screenshot:
bug.png


Spine Version: 4.1.08
Unity Version: 2022.1.15f1 (URP)
Spine-Unity-Runtime: 4.1 (2022.10.10)

Attach please find the demo project and spine project.
Please import the spine unity runtime to make the project work. I cant upload the whole project becase the limitation of the size of attachment.

Step to reproduce:
1. Open the project.
2. Open the 'SampleScene'
3. Click the Button once. Just once! And wait for the spine animation to finish.
4. After the spine animation is done and auto disabled.
5. Click the Button again, you can see the spine is not playing properly. Please open the scene view side by side.
You do not have the required permissions to view the files attached to this post.
Ward
  • Posts: 3

Misaki

Thank you for preparing the Unity project to reproduce the problem, I found the cause. You are calling AnimationState clearTracks, which leaves the skeletons in their current pose, so it is the cause that the previous animation affects a later animation in an undesired way. You can call Skeleton setToSetupPose after clearTracks() to back your skeleton to setup pose.
User avatar
Misaki

Misaki
  • Posts: 1164

Ward

Misaki wrote:Thank you for preparing the Unity project to reproduce the problem, I found the cause. You are calling AnimationState clearTracks, which leaves the skeletons in their current pose, so it is the cause that the previous animation affects a later animation in an undesired way. You can call Skeleton setToSetupPose after clearTracks() to back your skeleton to setup pose.
Thanks for your help so much. I managed to fix the problem by adding the following code after clearTracks
skeletonGraphic.Skeleton.SetToSetupPose();
skeletonGraphic.Clear();
Ward
  • Posts: 3

Misaki

I’m glad to hear the problem is fixed. Thank you for getting back to us!
User avatar
Misaki

Misaki
  • Posts: 1164


Return to Unity