Added varying sizes to bullets (Need to fix player/bullet collision issues so I can make bullets even smaller without getting spiraling bullet bugs

This commit is contained in:
Gregory Campbell
2020-07-11 11:31:39 -04:00
parent d908f9a503
commit 3da029586a
+3 -1
View File
@@ -28,7 +28,9 @@ public class PlayerScript : MonoBehaviour
if(Input.GetButton("Fire1") && myTime > nextFire) if(Input.GetButton("Fire1") && myTime > nextFire)
{ {
nextFire = myTime + 0.5f; nextFire = myTime + 0.5f;
Instantiate(bullet, transform.position, Quaternion.Euler(0,0,Random.Range(0.0f, 360.0f))); GameObject newBullet = Instantiate(bullet, transform.position, Quaternion.Euler(0,0,Random.Range(0.0f, 360.0f)));
float scaleChange = Random.Range(0.5f, 1.5f);
newBullet.transform.localScale = new Vector2(scaleChange, scaleChange);
nextFire = nextFire - myTime; nextFire = nextFire - myTime;
myTime = 0.0f; myTime = 0.0f;
} }