- Home /
 
 
               Question by 
               Nathan Bennett · Nov 18, 2010 at 09:07 PM · 
                animationconcurrency  
              
 
              how to play animation One after the Other?
hello, how do i play animation one after the other? i have a Gatling gun, where i want the Barrels to rotate- accelerating upwards, then at a constant speed, then de-accelerate when the fire1 button is released. i've down the latter, i just can't figure out how to play the "BarrelCons" animation directly after the "BarrelUP" animation.
tah!
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by oliver-jones · Nov 18, 2010 at 09:24 PM
var Fired = false;
 
               function Start() { Fired = false; }
 
                function Update()
 {
 if(Input.GetButtonDown("Fire1"))
     {
          animation.Play("BarrelCons")
          Fired = true;
     }
     else if (Input.GetButtonUp("Fire1") || Fired == true)
     {
         animation.Play("BarrelUP")
         Fired = false;
     }
 }
 
                
               
               I don't know if I have the animations the correct way round
i'm still not getting my desired results. i Hold the fire button down to fire (Input.GetAxis) so the first Animation starts, then the next animation after the Fired = true crossfades, and loses the first animation pretty much straight away.
Your answer