hello guys i’ve got a problem with my script right now can someone help me on that please ?
#pragma strict
var bulletCasing : Rigidbody;
var ejectSpeed : int = 100;
var fireRate : float = 0.5;
private var nextFire : float = 0.0;
private var fullAuto = false;
function Update () {
if(Input.GetButton("Fire1") && Time.time>nextFire){
nextFire = Time.time + fireRate;
var bullet : Rigidbody;
bullet = Instantiate(bulleCasing, transform.position, transform.rotation);
bullet.velocity = transform.TransformDirection(Vector3.left * ejectSpeed);
}
If(Input.GetKeyDown("v")){
fullAuto = !fullAuto;
}
If(fullAuto == true){
fireRate = 0.10;
}else{
fireRate = 0.5;
}