hey, I want to figure out how I can enable the player’s shooting script when he walks into a trigger. here is the shooting script that I want to be enabled:
var bullet : Rigidbody; //the bullet we are shooting must have a rigidbody
var Speed = 32000; //the speed the bullet is shot at
private var shooting = false; //this is only used if rapid fire is set to true
//RateOfFire private
var Counter = Time.deltaTime;
var RateOfFire = 0.5;
function FixedUpdate (){
if(Input.GetButtonDown("Fire1")){
shooting=true;
}
if(Input.GetButtonUp("Fire1")){
shooting=false;
}
if(shooting==true){
Counter += Time.deltaTime;
if(RateOfFire < Counter){
var shotRapid =Instantiate(bullet, transform.position, Quaternion.identity);
shotRapid.GetComponent.<Rigidbody>().AddForce(transform.forward * Speed);
Counter=0;
}
}
}
***this is not my script and i have no knowledge in coding. sorry lol.