Script to enable Firing

I want to create a script so that when the player touches an object, the player can now shoot. But with my script, the player can no longer shoot when he is no longer in contact with the object. I want the player to shoot even after he is no longer in contact with the object. Can anyone help?

void OnTriggerEnter2D(Collider2D other){ if (other.tag == "Blue cloud") { if (Input.GetButton ("Fire1") && Time.time > nextFire) { nextFire = Time.time + fireRate; Instantiate (shot, ShotSpawn.position, ShotSpawn.rotation);}}}

boolean canShoot = false;

void OnTriggerEnter2D(Collider2D other)
{ 
    if (other.tag == "Blue cloud")
        canShoot = true;
}

void Update ()
{
    if (canShoot) { 
        if (Input.GetButton ("Fire1") && Time.time > nextFire) { 
            nextFire = Time.time + fireRate; 
            Instantiate (shot, ShotSpawn.position, ShotSpawn.rotation);
        }
    }
}