make an animation plays only when the first one finishes

so im having a huuuuuge problem with this anim

i have two animations. and i want to make the first one plays completely so then it plays number two

heres the script i made, along with solutions i tried and didnt worked

animation.Play("subweapon1");
animation.CrossFadeQueued("subweapon2");

[COLOR="seagreen"](didnt work.. it plays only the first then cut off the secound)[/COLOR]
animation.Play("subweapon1");
if (animation.IsPlaying("subweapon1")) { } else {
animation.Play("subweapon2"); }

[COLOR="seagreen"](didnt freaking work.. it never evers get to play the secound one)[/COLOR]
animation.Play("subweapon1");
animation.Play("subweapon2"); 

[COLOR="seagreen"](didnt work.. it plays then both at the same bloody time.. 
and since the first one has more frames, i never even notice that it 
played the secound)[/COLOR]

Is the second one in a loop? Like in the update? If so, if subweapon1 finally isn’t playing at the end of the frame, at the beginning it will play again before it reaches the if() statement so that could be why it never returns false.

Try this.

//Play the Subweapon1 animation when 1 is pressed.
if(Input.GetKeyDown("1")){
animation.Play("subweapon1"); }

//Play the subweapon2 animation whenever subweapon1 is not playing.
if (!animation.IsPlaying("subweapon1")) {
animation.Play("subweapon2"); }

I know nothing of animation, but this seems more a problem of logic. (Hopefully I’m correct, lol)

it worked!! it worked my friend thanks for that!