faily simple, butit just dosnt like me.
error CS1501: No overload for method FireBurst' takes
0’ arguments
// if can shoot fire guns.
void Update()
{
if (IsShooting > 0) {
StartCoroutine(FireBurst());
}
}
//---------------------------------------------------------------------------------------------------------------------
IEnumerator FireBurst(GameObject bulletPrefab, int burstSize, float rateOfFire)
{
float bulletDelay = 60 / rateOfFire;
// rate of fire in weapons is in rounds per minute (RPM), therefore we should calculate how much time passes before firing a new round in the same burst.
for (int i = 0; i < burstSize; i++)
{
Rigidbody clone2;
clone2 = (Rigidbody)Instantiate (bulletPrefab, transform.position, transform.rotation);
yield return new WaitForSeconds(bulletDelay); // wait till the next round
}
}
}