Nate a écritIt might help to show the AnimationState setAnimation
and AnimationState addAnimation
calls you are making.
Jamez0r a écritIs there any way for the higher track mix to not include any lower tracks during the transition?
Yes, apply the higher track without transitioning from/to an empty animation. When mixing an animation on a higher track from an empty animation, you are mixing from the pose of the empty animation (which, since it is empty, is the pose of the lower track) to your higher track animation. If you don't want that, just set the higher track animation without mixing from anything. This will cause the higher track animation to be applied fully immediately. The same logic applies when mixing an animation out on a higher track.
Thanks Nate - the problem only happens when going between animations on track 1. Going from nothing on track 1, to the Raise_Sword animation is fine, and going from Swing_Sword back to nothing on track 1 is fine. Its when going from Raise_Sword to Swing_Sword, both on track 1, that I get the sway back towards the arm position in the "Run" animation on track 0. Either that, or it is swaying back to the Setup Pose position, the arm position in Setup Pose is close to where it is in the Run animation.
At Runtime, I'm applying the animations like this:
1) setAnimation(0, "Run", true);
2) [Player presses and holds mouse button]
addEmptyAnimation(1, 0.1f, 0);
addAnimation(1, "Raise_Sword", false, 0); //The character raises its sword and sits at the last frame of the animation until player lets go of mouse
3) [Player releases mouse button]
setAnimation(1, "Swing_Sword", false);
When the Swing_Sword animation starts, the arms are swaying either towards the position they would be during the Run animation, or the Setup Pose. It happens both at runtime, and if I use the Preview window in Spine.
Preview window in Spine:
1) Set track 0 to "Run", looping
2) Set track 1 to "Raise_Sword", not looping, mix 0.25 //Sword is raised overhead and sits there
3) Set track 1 to "Swing_Sword" just by clicking the "Swing_Sword" animation //Arms sway towards the position in the Run animation for a moment before completing the swing animation
If I remove the "Run" animation from Track 0 in the Preview Window:
2) Set track 1 to "Raise_Sword", not looping, mix 0.25 //Sword is raised overhead and sits there
3) Set track 1 to "Swing_Sword" just by selecting the "Swing_Sword" animation //Arms go directly from the Raise_Sword position to the Swing_Sword position
Not sure if the Preview window showing the same issue is helpful or not. Thanks for all the help :*