Hello, I want to create a shotgun for my game, that instanciates 3 bullets that all go in different rotations. The 3 bullets are instanciated but do not go in different rotations
here is an exerpt from my script to analyse:
if(isWeaponShotgun)
{
rotationbullet1 = Quaternion.Euler(0, 0, 20);
Debug.Log("rotation bullet 1" + rotationbullet1);
rotationbullet2 = Quaternion.Euler(0, 0, -20);
}
// new part of the code
void ShootShotgun()
{
Debug.Log("ShtgunShooot");
GameObject bullet = Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);
GameObject bullet1 = Instantiate(bulletPrefab, firePoint.position, firePoint.rotation * rotationbullet1);
GameObject bullet2 = Instantiate(bulletPrefab, firePoint.position, firePoint.rotation * rotationbullet2);
Rigidbody2D rb = bullet.GetComponent<Rigidbody2D>();
Rigidbody2D rb1 = bullet1.GetComponent<Rigidbody2D>();
Rigidbody2D rb2 = bullet2.GetComponent<Rigidbody2D>();
rb.AddForce(firePoint.up * bulletForce, ForceMode2D.Impulse);
rb1.AddForce(firePoint.up * bulletForce, ForceMode2D.Impulse);
rb2.AddForce(firePoint.up * bulletForce, ForceMode2D.Impulse);
gunSound.Play();
currentAmmo--;
Destroy(bullet, range);
Destroy(bullet1, range);
Destroy(bullet2, range);
}
But the bullet rotation does not change ( the