- Home /
Question by
Npkhan · Sep 27, 2021 at 11:59 PM ·
animationanimatoranimation controller
Play one animation after finishing another animation using bool variable.
I am holding a pistol. Now if I press 2, I want to play (pistol back to my pocket) animation first then after ending animation, another (sword taking) animation will start.
if (Input.GetKey("2"))
{
animator.SetBool("pistol_back_animation", true);
animator.SetBool("sword_taking animation", true);
//second animation will start only after finishing first animation.
}
Comment
If you only have 1 concrete state (pistol's animation before sword's animation), just set it that way in your animation's animator (with no condition between them). Pistol's animation ends -> onto sword animation.
Your answer
![](https://koobas.hobune.stream/wayback/20220613043540im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How would one make a Health Bar decrease if a player is in a specific animation state? 1 Answer
Copy the state of one animator to another 0 Answers
Animations don't work with humanoid avatars 0 Answers
How to nest Animation file in an Animation Controller? 1 Answer
Precise animation control 4 Answers