!!!BCE0044: expecting EOF, found 'else'.!!!!!!

// im getting this error in the title with the else part what did i do wrong i try respecting the bracket like others script but this one doesn’t seem to like it.

var animator : Animator;

function Start () {

 animator = GetComponent( Animator );
}

function Update () {
 if (Input.GetMouseButtonDown (0))
     {
       shootAnimation ();
     }
}

function shootAnimation ()
{
           animator.SetBool( "shoot" , true);
}
else // this part

{

if (Input.GetMouseButtonUp (0))
{
                     animator.SetBool ( "shoot", false);
}
}

// im using the animator of unity mechanic and im trying to tell that if the player stop touching the mousebutton it will become false.(back to idle).

Before else, there should be if, or else if statement, you don’t have neither.

Also, that else, and if are not in any function.

function Start (){   
    animator = GetComponent( Animator );
}
 
function Update(){
    if (Input.GetMouseButtonDown (0)){
        shootAnimation ();
    }
}
 
function shootAnimation(){
    animator.SetBool( "shoot" , true);
 
    if (Input.GetMouseButtonUp(0)){
        animator.SetBool ( "shoot", false);
    }

    else{
        //your else
    }
}