if(other.tag) Problem

So i made this script that when it collides with a speciel object, it gets destroyed.
But when i save the script it says: Assets/Scripts/BrickHit.js(7,6): BCE0005: Unknown identifier: ‘other’.

This is the script:

#pragma strict

var Health:int = 10;

function OnCollisionEnter(collision : Collision)
{
    if (other.tag == "EBall") 

    Health=Health-10;

    if(Health==0)
       Destroy (gameObject);
}

I don’t know how to fix it. I think its something with the ““other.tag”” statement.

Try

function OnCollisionEnter(collision : Collision) { if (collision.gameObject.tag == "EBall")

collision.gameObject.tag is the tag of the gameObject collided with.

You have no variable called “other” in your script. The parameter in OnCollisionEnter is called collision in your code. What you wanna test is the tag of this collision object :

collision.gameObject.tag == “EBall”