Need some help with bullets spread fire!!!

Here i’m developing a top down space shooter game where the player shoots bullets in upward direction , i’m trying to implement some power-up among which i’m stuck with the spread fire , where i want to spread the bullets in a particular angle. This is the code i’m using

[SerializeField]   int bulletCount;
[SerializeField] float spreadAngle;
List<Quaternion> bullets;


void Start()
    {
        bullets = new List<Quaternion>(bulletCount);
        for(int i = 0 ; i<bulletCount ; i++)
        {
            bullets.Add(Quaternion.Euler(Vector3.zero));
        }
    }

public void Fire()
    {
        if(GameObject.Find("Player") !=null)
        {
            for (int i = 0; i < bulletCount; i++)
            {
                bullets *= UnityEngine.Random.rotation;*

var FireBullet = FindObjectOfType();
GameObject Projectile = Instantiate(Laser, new Vector3(FireBullet.transform.position.x, FireBullet.transform.position.y + 0.5f,FireBullet.transform.position.z),transform.rotation) as GameObject;
Projectile.transform.rotation = Quaternion.RotateTowards(Projectile.transform.rotation, bullets*, spreadAngle);*
Projectile.GetComponent().velocity = new Vector2(0, FireDistance);
Projectile.GetComponent().AddRelativeForce(Projectile.transform.forward * 10f);
}
}
}
The bullets gets rotated but they all stick together and move upwards, there is no spread happening.
please can someone help me out with this kinda stuck on it for a while… Thanks in advance.:slight_smile:

Hello.

You should imstantiate new bullets at the spread position, and give them velocity in an angle. AS i see you are very close. You shoulddebug your code line by line while running to detect where the code is not doing what you expect.

Bye!