public var enemy:GameObject; enemy = GameObject.FindGameObjectWithTag(\"enemy\"); function OnTriggerEnter(other:Collider) { if(other.gameObject.tag == \"enemy\")
If you use the 2D physics engine, you need to use the 2D functions:
function OnTriggerEnter2D(other: Collider2D) { if(other.tag == "enemy") { Debug.Log("Dead"); Destroy(gameObject); } }