How do I destroy a game object when it is hit by a weapon?

So I’ve been following this tutorial series on youtube. One of the videos in the series teaches you to animate a weapon in Unity and add an event at a particular frame of the animation so that the “enemy” object is destroyed when it is hit by the weapon.

But the problem is that I didn’t use Unity to animate my weapon. I used blender. So I don’t how to add an event to my animation. Is there an alternative way to do this? And for the record, I’m using javascript for my scripting.

First thing would be to put a collider on your weapon (I’m imagining sword for this example). Make sure this collider is roughly the right size/shape of your sword, and that it surrounds it nicely.

Secondly, using @ownerfate 's code and applying it to the sword should give the desired effect. The idea is that the object will only be destroyed when the swing of the sword puts it in contact with the object.

The easiest way If It’s a sword or something, first tag your sword as weapon or something.And add this script to what do you want to destroy.

 function OnCollisionEnter(col : Collision){
 if(col.gameObject.tag == "WeaponOrSomething" ){
       Debug.Log("Wow! ITS WORKS MAN OMG!!");

As it’s a gun you can use Raycast from it.

 if (Physics.Raycast(ray, hit) && (hit.transform.gameObject == transform.gameObject))
           {  ...
             Destroy(hit.transform.gameObject); // destroy the object hit

Alsow check this for incase Unity - Scripting API: RaycastHit