I have a problem for some reason, I have no damage being dealt onto the enemies that I shoot at here is the script that I had used:
HandGundDamage.jv:
var DamageAmount : int = 6;
var TargetDistance : float;
var AllowedRange : float = 16;
function Update () {
if(Input.GetButtonDown(“Fire1”)) {
var Shot : RaycastHit;
if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), Shot)) {
TargetDistance = Shot.distance;
if (TargetDistance < AllowedRange) {
Shot.transform.SendMessage(“deductPoints”, DamageAmount);
}
}
}
}
Somebody please help as soon as possible.