- Home /
Duplicate Question
BCE0043 :Unexpected token: :.
hello this is my second time asking for help on this script this gun script had been driving me crazy could someone be kind enough to help me please.
p.s this is a raycast script
#pragma strict
var Range : float = 1000;
var Force : float = 1000;
var Clips: int = 20;
var BulletsPerClip : int = 6;
var ReloadTime : float = 5;
var BulletsLeft : int = 0;
var ShootTimer : float = 0;
var ShootCooler : float =0.9;
public var ShootAudio : AudioClip;
public var ReloadAudio : AudioClip:
function Start(){
}
function Update () {
if(Input.GetKey(KeyCode.F)) {
RayShoot();
}
}
function RayShoot () {
var Hit : RaycastHit;
var DirectionRay = transform.TransformDirection(Vector3.forward);
Debug.DrawRay(transform.position , DirectionRay * Range , Color.blue);
if(Physics.Raycast(transform.position , DirectionRay , Hit, Range)){
if(Hit.rigidbody)(
Hit.rigidbody.AddForceAtPosition( DirectionRay * Force , Hit.point);
}
}
}
function Reload()(
}
function PlayShootAudio()(
}
function PlayReloadAudio()(
}
On lines 46, 52 and 61, you have a '(' when you should have a '{'.
And your error is likely one 12, where you have a ':' ins$$anonymous$$d of a ';'.
Answer by AlwaysSunny · Oct 26, 2014 at 04:59 AM
Questions like this are unlikely to pass moderation or receive answers. You haven't described the problem you're experiencing, for one thing. Asking for "help on this script" is not sufficient.
I glanced over the code and spotted an error on line 33. There is a ( which should be a {
Follow this Question
Related Questions
BCE0044: expecting (,found 'RayShoot' 1 Answer
A node in a childnode? 1 Answer
Timing Between each Gun Shot 2 Answers
Set npc to inactive when certain distance away from controller (script not working) 0 Answers
Animation & Script Help 2 Answers