Need Help With Animations! In C#

So I A Complete Newbie At Unity, But I have this problem, I have my rifle, and a couple Animations On It:
Aiming down Sights
Shooting Without Aiming Down Sights
Shooting With Aiming Down Sights

Shooting With Aiming Down Sights Is Just The last key frame from The Aiming Down Sights Animation, But With A recoil Effect, But when i detect input and Play the Aiming Down Sights Shooting Animation While i’m aiming down the sights of course, It does this weird pull down thing, This Is My Code, Basically what i want to accomplish is a smooth recoil effect from my previous animation
public class AnimPlays : MonoBehaviour {

public bool isSighted = false;

void Update ()

	if(Input.GetButtonDown("Fire1") && isSighted == false)
	}else if (Input.GetButtonDown ("Fire1") && isSighted == true)

		isSighted = true;
		isSighted = false;

	if(isSighted == true)

	if(isSighted == false)


Much Apreciated, Cheers!

I find it better to use AnimationClips than Animations.

Make several public AnimationClip parameters, and assign the animations to each one.

Then when you call animation.CrossFade(

The ‘.name’ is important because it references the string value bane of the animation instead of hardcoding the animation names.

Normally what you want to do when shooting a rifle like object, you want the animation to be on the humanoid character (if that’s what you have) and mount the rifle to it’s hand bone. If you are new to Unity and game programming I would suggest doing it that way because unity handles smooth transitioning between animations for you. You should consider using Mecanim animations.

For example, if you want a recoil effect on your character you would have 2 animations with maximum recoil effect and zero recoil effect and blend them by using Mecanim’s Blend tree. You can than give a value to each weapon in your game called “Recoil” between values 0 and 1 and feed it to Mecanim.

But if you insist on using legacy animations, you are going to have to develop your own Blending. Which is not trivial but there are some tutorials out there about the subject on 3Dbuzz.

Hope this helps.