- Home /
how to make the animation stop after clip end ?
I want make the animation clip stop when the clip end, now it's stop in the point of button up. I use this code :
function Update ()
{
if (Input.GetMouseButtonDown(0))
{
animation.Play("Shoot01");
}
if (Input.GetMouseButtonUp(0))
{
animation.Stop("Shoot01");
}
Answer by 767_2 · Sep 26, 2014 at 08:13 PM
you can set an animation event in animations last frame animationEvents
one question , why you put it to loop if you want it to stop after you played it
this animation for shooting, when button hold == loop, when button up == stop, but it should stop after clip end, not stop before clip end (stop in the middle of clip) r u understand me ?!!! I hope u do cuz that what can I say or upload video for it :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613163822im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
find animation ? 4 Answers
How can I increase the value of a variable? 1 Answer
wrong rotation to animation per 0 Answers
Character does not jump 1 Answer
Animation Vs Animator 2 Answers