Shooting system not working

Hey guys how’s it going? I am trying to make a script for shooting using RayCast I wrote it so that when the RayCast hits an object tagged “enemy” and the player presses fire1 enemy will take damage but no damage is done:

var bullet : Rigidbody;
var speed : float = 20;

function Start () {
attackTimer = 0;
}

function Update () {
var hit : RaycastHit;
if(Physics.Raycast(transform.position, transform.forward, hit, 3)){
if(hit.collider.gameObject.tag == "Enemy"){
if(Input.GetButtonUp("Fire1")){
Shoot();
}
}
}
}


private function Shoot (){
var newBullet : Rigidbody = Instantiate(bullet, transform.position, transform.rotation);
newBullet.velocity = transform.forward * speed;
var eh : EnemyHealth = GetComponent("EnemyHealth");
eh.AdjustHealth(-10);
}

Any ideas/fps tutorials?

Well the ray is casting but only 1 enemy is taking damage here’s the script:

var force : float = 10;
var range : float = 200;
var enemies : GameObject[];
var enemy : GameObject;
function Start () {
enemies = GameObject.FindGameObjectsWithTag("Enemy");
enemy = enemies[0];
}

function Update () {
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.collider.tag == "Enemy" && Input.GetButtonUp("Fire1")){
enemy = enemies
var eh : EnemyHealth = enemy.GetComponent("EnemyHealth");
eh.AdjustHealth(-10);
}
}
}

I want enemy to change depending on where the player is aiming. Any idea guys?