Animation Problems

I have animated a gun on blender, imported it into unity and wrote a simple script which plays it when the LMB is clicked. But when I do click the LMB it only plays half the animation, I had this problem before but I fixed it by having the animation loop which I cannot do this time because its a pistol. Can anyone help me with this?

This is the script im using;

function Start () {

animation[“shoot”].speed = 1.8;

}

function Update () {

if(Input.GetButtonDown(“Fire1”)){

animation.Play(“shoot”);

}

}

If the animation is too long, it will be restarted with every time you shot.

Try to use animation.CrossFade() or let your animation play faster :slight_smile: