EsotericSoftware / spine-runtimes

2D skeletal animation runtimes for Spine.
http://esotericsoftware.com/
Other
4.42k stars 2.92k forks source link

[godot] Constraints do not mix out properly when animation is set with TimeScale set to 0 #2607

Open misaki-eymard opened 3 months ago

misaki-eymard commented 3 months ago

Description: If you set an animation with a TimeScale of 0 that sets an IK Constraint Mix to 100, such as Spineboy's aim animation, and then set the TimeScale back to 1 and use set_empty_animation() to mix out that animation, you will not be able to mix out the constraint correctly. As far as I can tell, this only happens if the TimeScale is set to 0 when the animation is set, not if it is non-zero, like 0.0001.

Video showing this issue: https://github.com/user-attachments/assets/7e22254d-5f5c-429d-a060-0f6d5f7f97c7

Expected behavior: Even if the TimeScale was 0 when the animation was set, it will mix out correctly when set_empty_animation() is called.

Steps to reproduce:

  1. Download the attached .zip file: Constraints-issue-when-TimeScale-is-0.zip
  2. Unzip and open the project in it with Godot 4.2.2.
  3. Play Constraints-issue-when-TimeScale-is-0.tscn.
  4. Right click anywhere in the scene view. This will set the TimeScale to 0 and the target animation to track 1. Drag the mouse to make sure that Spineboy follows the position of the crosshairs.
  5. Then left click anywhere. This will set the TimeScale to 1 and set an empty animation on track 1, but you can see that Spineboy is still aiming at the crosshairs.

The version of runtime in which this problem was found: Godot 4.2.2

This problem was reported in the following thread on the forum: https://esotericsoftware.com/forum/d/26716-ik-and-transform-constraints-applied-after-setting-a-tracks-animation-to-empty