Collision detection

Hi, I’ve got a collision detection script that if i put on a weapon that is attached by script to my models hand, and when he hits anything with it, it does not fire, is this right?, the weapon and the item being hit have colliders on them, I’ve tried this simple script to test.

function OnCollisionEnter() {

Debug.Log(“Hit”);

}

and it still does not fire … any ideas ?

You need to put the “collision : Collision” in the method parameters

// Play a sound when we hit an object with a big velocity
function OnCollisionEnter(collision : Collision) {
    if (collision.relativeVelocity.magnitude > 2)
        audio.Play();
}

http://unity3d.com/support/documentation/ScriptReference/Collider.OnCollisionEnter.html?from=Collision