• RuntimesGodot
  • Matching physics constraint timing to scaled Spine animation in Godot

This question assumes a situation where a hair SpineSprite is displayed on Godot and a hair swaying animation is played.

If I execute the following code and change the hair swaying animation to 3x speed, how can I change the playback speed in physics_constraint from 1 to 3x?

 animation_state = get_animation_state()
animation_state.set_time_scale(3.0)

In short, I want the cycle of the hair swaying animation to be the same as the cycle of the physics constraint.

Related Discussions
...

The physics are updated by a call to Skeleton::update() inside SpineSprite. I think it is easier for me to add a SpineSprite::set_time_scale which will scale the delta time passed to the update methods of AnimationState and Skeleton, instead of you having to do all this manually.

E.g. if you want to slow down to 50% real-time, you would do:

sprite.set_time_scale(0.5)

I've opened an issue here:
EsotericSoftware/spine-runtimes2832

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

    Mario
    thank you!