Aim down sights animation help

I have made an animation inside unity for my gun theres two animations 1 that aims in and one that aims out I have wrote a simple script that triggers them if the RMB has either been pressed down or up. I was hoping it would make my gun aim down its sights when the RMB has been clicked and when let go of plays an animation back to its starting position. This does not work instead my gun sort of jerks into the aim down sights position and then changes back before I have let go of the RMB. How would I change my script (or animations) so that my gun plays an aim down sights animation and stops where it finishes before I let go of the RMB which plays the animation back to its original place?

Script

function Start () {

animation.wrapMode = WrapMode.Once;

}

function Update () {

if(Input.GetButtonDown(“Fire2”)){
animation.Play(“aim down sights”);
}

if(Input.GetButtonUp(“Fire2”)){
animation.Play(“aim down sights2”);
}

}

Hey

You just need one animation. The one to aim downsight.

This is a part of my aimAnimationScript for a M4:

if(Input.GetMouseButtonDown(1))
{
animation["ScopeAnimationM4"].time =0;
animation["ScopeAnimationM4"].speed = 1;
animation.CrossFade("ScopeAnimationM4");
}

if(Input.GetMouseButtonUp(1))
{
animation["ScopeAnimationM4"].normalizedTime=1;
animation["ScopeAnimationM4"].speed=-1;
animation.CrossFade("ScopeAnimationM4");
}

This way you can just reverse the animation to aim downsight.
By the Way:
I did it so that the scope animation is not on the model but on an empty gameobject which is the first parent of the model. This way it won’t interfere with for example shot or walk animations.

Hope this helps.