I’m not very good at scripting, and I can’t script. I can make edits on variables and integers but that’s it. Could you add a revision or a script I could insert? Thanks.
#pragma strict
var bullet : GameObject;
private var shooting = false;
function Start() {
InvokeRepeating("Shoot", 0.0, 1.0 / bulletsPerSecond);
}
function Shoot() {
if (!shooting) return;
var go = Instantiate(bullet, transform.position, transform.rotation);
go.rigidbody.AddRelativeForce(Vector3.forward * 2500.0);
Destroy(go, 2.0);
}
function Update(){
shooting = false;
if(Input.GetAxis("Fire1")){
shooting = true;
}
}
private var bulletsPerSecond = 20.0;