if(Input.GetButtonDown("Fire1") && !reloading && shot == "spread")
{
var i : int = 3;
while(i > 0)
{
clone = Instantiate(bullet, transform.position, transform.rotation);
i--;
}
ammo--;
}
If I remove the while loop the bullets shoot straight like normal. But I want to do a spread shot and this method is causing the bullets to spiral off the screen. Any ideas on how to do a spread shot would be appreciated.
Your script are creating 3 bullets instances at same time, position and rotation.
If your bullets have colliders this can be a problem because they will collide thenselves
Try to remove colliders if they have.
Looking at your script, I assume that the acceleration of the bullets is not in this script. Maybe it's in a script attached in the bullets, like Johan posted.