How can i get this script to shoot faster the fire rate does not seem to be working?
#pragma strict
//Attach to empty object, in front of barrel
var projectile : Rigidbody;
var speed = 20;
var fireRate = .5;
var mySound : AudioClip;
function Start() // Vic - Start instead of Update, to only run this one time
{
InvokeRepeating("Fire",1,fireRate); // Vic - FireRate instead of constant 0.3
}
function Fire()
{
audio.PlayOneShot(mySound);
var instantiatedProjectile : Rigidbody = Instantiate(
projectile, transform.position, transform.rotation );
instantiatedProjectile.velocity =
transform.TransformDirection( Vector3( speed, 0, 0 ) );
Physics.IgnoreCollision( instantiatedProjectile. collider,
transform.root.collider );
// Vic - Don't cancel the invoke here or it'll only fire once
}