Trouble with continous shooting in 2D top Down smup

Hi. Im completly new to unity and programming so please forgive me if my question is dumb.
I was trying to implement continous shooting in 2d smup game using this piece of script.

public class PlayerShooting : MonoBehaviour
{
    public Transform P696muzzle;

    public GameObject BulletPrefab;

    public float BulletForce = 5f;

    public float fireRate = 10f;
    void Update()
    {
        if (Input.GetButtonDown("Fire1"))
        {
            InvokeRepeating("Shoot", 0.001f, fireRate);
        }
        else if (Input.GetButtonUp("Fire1"))
        {
            CancelInvoke("shoot");
        }
    }

    void Shoot()
    {
        GameObject bullet = Instantiate(BulletPrefab, P696muzzle.position, P696muzzle.rotation);
        Rigidbody2D rb = bullet.GetComponent<Rigidbody2D>();
        rb.AddForce(P696muzzle.up * BulletForce, ForceMode2D.Impulse);
    }
}

The problems is that it continues firing when the button is released and im having troubles adjusting fire rate

Fire1 is mouse 0

A typo. CancelInvoke(“shoot”); should have a capital S.

And, well, I don’t exactly know what you mean by “trouble adjusting fire rate”, but if you want your code to shoot 10 times per second, you have to invert the value to 1 / 10.