how to play another animation on different object after the first one

ive created a QandA Game where in when you click ATTACK button a GUI with question will pup up then after you choose the correct or incorrect answer a certain animation will play, my problem is after the first animation play after you choose an answer, i want another animation to plays in the other object, im really new in this thing so i hope you understand me thank you

1 Like

Just keep track of what object is currently animating. When the first object is done animating then start the animation for the second object.

private int curAnimation = 0;

public void update() {
    if(curAnimation == 0 && !animationOne.isPlaying()) {
        curAnimation = 1;
        animationTwo.play();
    }
}