so here is my problem after some coding i came up with a simple error "UCE0001: ';' expected. Insert a semicolon at the end." here is my script and the error is on 46,17. I clearly put a semicolon there but i still get the error. Please help!!!! (Javascript)
error on line 46,17
var Bullet : Rigidbody;
var Spawn : Transform;
var Bulletspeed : float = 1000;
var ReloadTime : float = 2;
var AmmoInMag : float = 30;
static var AmmoLeft : float;
private var CanFire = true;
function Start () {
AmmoLeft = AmmoInMag;
}
function Update () {
if(Input.GetButtonDown("Fire1")){
if(AmmoLeft > 0){
BroadcastMessage("FireAnim");
Fire();
}
}
if(AmmoLeft == 0)
{
Reload();
}
if(AmmoLeft > 0){
AmmoLeft = 0;
}
}
function Fire(){
if(CanFire == true){
var bullet1 : Rigidbody = Instantiate(Bullet,Spawn.position,Spawn.rotation);
bullet1.AddForce(bullet1.transform.forward *Bulletspeed);
AmmoLeft -= 1;
audio.Play();
}
}
function Reload(){
CanFire = false;
Brodcast Message("ReloadAnim");
yield WaitForSeconds(ReloadTime);
CanFire = true;
}
↧