How to avoid next animation to start before previous one has finished with Animator?
I am using Animator to animate a door closing/opening. There are two states: Open (which plays animation of door opening) and Close (which play animation of door closing). To switch between these states there is boolean Open. My script is something like that
Animator anim = this.GetComponent();
if (Input.GetKeyDown (KeyCode.Keypad1)) {
if (anim.GetBool ("Open") == false) { anim.SetBool ("Open", true); } else { anim.SetBool ("Open", false); } }
My problem is that if i quickly press "1" multiple times, the next animation starts before the previous one has finished, creating a weird effect. How can i avoid it? Can i check when the animation has finished in some way?
Your answer
Follow this Question
Related Questions
How do I puse an animation? 1 Answer
How to set the blend tree threshold value during run time? 0 Answers
Why default animation state rewrites scale of an object? 0 Answers
Animation Running Game 0 Answers
Specific Animation not Playing 0 Answers