Question by
Cjegames · Dec 20, 2015 at 11:37 AM ·
parsing error
Unity parsing error
Hi there, I am coding a script that allows a gun to shoot and it comes up with: Parsing Error. Here is my code:
var bullet : Transform;
var Speed = 32000;
private var shooting = false;
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.rigidbody.AddForce(transform.forward * Speed);
Counter=0;
}
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612053310im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
parsing error 1 Answer
Invalid PBX project - iOS Build Help! 2 Answers
error CS8025: Parsing error 1 Answer
Parsing error 1 Answer