im making a timer and it spawns thousands of bullets here is my code
{
private const float V = 10f;
public Rigidbody bullet;
public Transform EnemySpawner;
public Transform enemyspawnPoint;
float timePassed = 0f;
void Start()
{
}
void Update()
{
timePassed += Time.deltaTime;
if(timePassed > 5f)
{
Rigidbody bulletInstance = Instantiate(bullet, enemyspawnPoint.position,
enemyspawnPoint.rotation) as Rigidbody;
bulletInstance.AddForce(enemyspawnPoint.forward * 20f);
}
}
}