How do you add bullet spread to a 2D Top down Shooter?

I am trying to add bullet spread to this script:

//Shoot a bullet
IEnumerator Shoot(int extraShot)
{

    //Generate a random value
    int randomVal = Random.Range(0, 180);
    Vector3 spread = new Vector3(0, 0, randomVal-90);

    //Add a bullet

    GameObject bullet = Instantiate(bulletPrefab, firePoint.position,     Quaternion.Euler(firePoint.rotation.eulerAngles + spread)); 

     //Get Rigidbody2D
    Rigidbody2D rb = bullet.GetComponent<Rigidbody2D>();

     //Add a force
    rb.AddForce(firePoint.up * bulletForce, ForceMode2D.Impulse);
 
    yield return new WaitForSeconds(0);

}

I want the bullet to deviate once it is fired out of the firepoint. I have tried to changing the code myself by adding spread to the firepoint rotation but it only rotates the graphics of the bullet prefab instead of the direction it travels.

Presumably the problem lies with the force that you apply.
The way I see it now, it looks like you add an up force from the firepoint instead of the bullet which is rotated.

Therefore I would say that you should change

rb.AddForce(firePoint.up * bulletForce, ForceMode2D.Impulse);

to

rb.AddForce(bullet.tranform.up * bulletForce, ForceMode2D.Impulse);

This hasn’t been tested, so you might need to change the direction from .up to .right or maybe the negative on that.

Good luck!