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()(
}