I need the projectile to be instantiated once every second. Instead the projectiles instantiate like crazy.
function Update(){
if (Vector3.Distance(transform.position, p1.transform.position) < 10)
{
InvokeRepeating("Shoot",0, 1);
}
function Shoot()
{
Instantiate(projectile, shooter.position,shooter.rotation);
}
}
↧