making a trail that destroys enemies

after searching for a way to do this i found a script from robertbu that should work for detecting collisions, i’m trying to make it so that when this system detects a collision with “Virus” by using other.CompareTag like you would with ontriggerenter(other:collider).
Here’s the neccesary part of the script.

function Update() {
    if (Hit() == true){
         if (other.CompareTag("Virus")){
    		Destroy(other.gameObject);
    		 }
    	}
}

function Hit() : boolean {
    var i = head;
    var j = (head  - 1);
    if (j < 0) j = arv3.Length - 1;

    while (j != head) {

        if (Physics.Linecast(arv3*, arv3[j], hit))*

return true;
i = i - 1;
if (i < 0) i = arv3.Length - 1;
j = j - 1;
if (j < 0) j = arv3.Length - 1;
}
return false;
}*/

If I understand correctly, replace lines 16 and 17 with:

    if (Physics.Linecast(arv3*, arv3[j], hit) && hit.collider.tag == "Virus") {*

Destory(hit.collider.gameObject);
}
With this change, you don’t want to return a boolean.