- Home /
Not able to make animation wait
public IEnumerator Wait(float waitTime){
yield return new WaitForSeconds(waitTime);
this.animation.Play ("yes");
this.animation["aayaneho"].wrapMode = WrapMode.Once;
}
void Update(){
if(!animation.isPlaying ) {
StartCoroutine(Wait(10.0f));
}
if(Input.GetKeyDown(KeyCode.S)) {
this.animation.Stop("yes");
this.animation.Play("a");
this.animation.Play("b");
}
}
The scene is first it waits for 10 secs. Then it plays the yes animation.When i press the S key, it plays a and b animation and returns back to the yes animation. But what i want is to try stopping the yes animation and wait for 10 secs after the a and b animation is played and then play this yes animation again. So if key S is pressed when animation yes is being played, i want the yes animation to stop and play a and b animation to play.Then wait for 10 seconds if key S is not pressed then play this yes animation.
Your answer
Follow this Question
Related Questions
Show activity indicator in center of screen 0 Answers
ASDAsdASDasdqweqw3edqwdQWDEqwedQWD 3 Answers
Create Circular Motion to follow the object 2 Answers
whole animation not being played 0 Answers
Create reset button to main camera 1 Answer