Key Pressed Otherwise

I’m trying to make a gun animation setup:
var bluelazer : GameObject;

function Update () {

if (Input.GetAxis("Fire1")){
Instantiate(bluelazer,transform.position,transform.rotation);	
 

}

}

I want it to play the firing animation of the gameobject Gun when the key is pressed and I want it to play the stopping animation once you let go of the key. Please help.

Nope, Keyframe 1-20 = Firing (Gun Starts)
Keyframe 30-40 = Stopping (Gun Stops)

I’m asking how would you do a correct ‘if else’ script that starts animation ‘Stopping’ once as soon as you stop firing and animation ‘Firing’ as soon as you start firing.

To respond to a button going down, check:

if (Input.GetButtonDown("Fire1"))
    // do something when the button went down

To respond to a button going up, check:

if (Input.GetButtonUp("Fire1"))
    // do something when the button went up