- Home /
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
You just posted this same exact code in an earlier post at link text. Are these two different questions, and did my answer fulfill your question on your other post?
This seems like it may be a different issue. So, please clarify this:
want another animation to plays in the other object
What other object? Please explain your problem more thoroughly.
sorry for not explaining it thoroughly im really bad at english so im really sory but here it is,
after my first animation play for the first object Plays , i want the second animation plays for my second object, i cant really explain it well but, its like fighting first object punch then the other object returns the punch its like that
Answer by Nanobrain · Feb 04, 2014 at 06:35 AM
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();
}
}
i cant really understand but i think its the correct answer to my problem but im getting errors im really a newbie for this im really sory but im still trying to figure it out
the name animationone does not exist in current context
The code I posted above is just an example, it will not compile. You'll have to grasp the idea of it and apply within your code.
Just let me know if you run into any more problems with this.