I need help with bullet spread in a top down 2d game
My current code, located in a script that recieves an input from the player is:
void Shoot()
{
Quaternion spread = firePoint.rotation * Quaternion.Euler(0,0, Random.Range(-100f, 101f)); GameObject bullet = Instantiate(bulletPrefab, firePoint.position, spread);
Rigidbody2D rb = bullet.GetComponent<Rigidbody2D>();
rb.AddForce(transform.up * bulletForce, ForceMode2D.Impulse);
}
However, this does not seem to have any effect
Any idea why?