How do you shoot bullets constantly but have a short pause in between each bullet

I am making a game where the player moves a spaceship with a mouse, and automatically shoots things that randomly spawn from the top of the screen. However, when I try to make it shoot bullets, the bullets shoot, but there isn’t any space in between each bullet. Any suggestions?
This is the code I am using:

    public GameObject playerBulletPrefab;
    private float startDelay = .75f;
    private float shootInterval = 5.0f;

    void Start()
    {
        
    }

    void Update()
    {
        InvokeRepeating("ShootBullet", startDelay, shootInterval);
    }
    void ShootBullet()
    {
        Instantiate(playerBulletPrefab, transform.position, playerBulletPrefab.transform.rotation);
    }

Hi,

The reason for this is simple, you are InvokeRepeating in Update() instead of Start(). Update is called by Unity once per frame so in your case bullets are spawning once per frame. If you move this Invoke to Start the bullets will spawn at the interval of 5 seconds.