Playing aniamtion automaticly

Hi, im here today to ask you about animation

is it possible to make it so that, for instance when you hit the fire key on the mouse then let go straight after you hit it the animation will keep playing… to tell you a little but more, i have modeled a sniper with hands and made it shoot then reload right after its shot… but i have to keep hole off the fire button for the animation to still run through is there any other way i could do it so when i actully press the fire it plays automaticly if soo please help :frowning:

Thanks

You probably want to use a yield statement. You can yield for animations:

var firing = false;
function Fire () : IEnumerator {
     firing = true;
     //Do firing stuff.
     animation.CrossFade("FireAnimation");
     while(animation.IsPlaying("FireAnimation") ) {
           yield;
     }
     firing = false;
}