I spent some time trying to use tweens to call a stopAnimation() method when an action is done, but it seems to cause all layers of the animation rig to bug out and pause half way through playing the next animation, even when the stopAnimation() method is blank.
So either something is wrong with tweens ,or my code below is wrong.
Here was the code I tried using for a non-loop mode that I thought should work.
if(!loopMode.equals(LoopMode.Loop)){ ///non looping
Action tempAction = animComposer.action(currentAnimation);
Tween doneTween = Tweens.callMethod(this, "stopCurrentAnim");
singleAction = animComposer.actionSequence(currentAnimation + "_nonLooping", tempAction, doneTween);
animComposer.setCurrentAction(currentAnimation + "_nonLooping", layerName);
}else{
animComposer.setCurrentAction(currentAnimation, layerName);
}
And here is the stop animation method it should call when done.
public void stopCurrentAnim(){
// if(armatureMask != null){
// animComposer.removeCurrentAction(layerName);
// }
//
// currentAnimation = null;
}
I commented out all the code so this method does nothing, but still I get interruptions in the following animations when I use tweens to call the method when an action is done, even on layers that were running an entirely different looping animation the whole time
I’m personally not very invested in solving this because I got things to work without tweens (using timers instead) and the bugginess goes away. But I might use tweens for other stuff in the future so I thought I should at least report this to see if its something I’m doing wrong, or if its an issue with using tweens to call a method after an action.