so i have a problem both bullets are instantiating perfectly except bullet2 only ever instantiates once and when the button is pressed again it doesn’t instantiate bullet 2 ever, only bullet 1 always instantiates properly.
if(facingRight && Input.GetKeyDown(KeyCode.Q))
{
Rigidbody2D bullet1Prefab;
anim.SetBool("shoot",true);
bullet1Prefab = Instantiate(bulletPrefab, BulletSpawn.position, BulletSpawn.rotation) as Rigidbody2D;
bullet1Prefab.AddForce(BulletSpawn.right * 100);
shootHappened();
}
if(!facingRight && Input.GetKeyDown(KeyCode.Q))
{
Rigidbody2D bullet2Prefab;
anim.SetBool("shoot",true);
bullet2Prefab = Instantiate(bullet3Prefab, BulletSpawn2.position, BulletSpawn2.rotation) as Rigidbody2D;
bullet2Prefab.AddForce(BulletSpawn2.transform.position = go * 100);
shootHappened();
}
Any help would be appreciated. (also the bulletspawn2.transform.position = go is assigning the bullet to go left not right since for some reason unity technologies thinks in 2D the player is ever only going to go right)