To achieve smooth transitions between animations in Godot using Spine, you should utilize the animation mixing feature provided by Spine. When you set a new animation to an AnimationState
, it will be mixed with the previous animation according to the set mix duration, allowing for a smooth transition. You can set the mix duration using the setMix
method on the AnimationStateData
object. This will ensure that when you disable a SpineBoneNode
or change animations, the transition is smooth rather than immediate.
For example, you can set the mix duration like this:
widget.state.data.setMix("previousAnimation", "newAnimation", 0.5);
This code sets a mix duration of 0.5 seconds between the "previousAnimation" and "newAnimation", allowing for a smooth transition.