OnCollisionEnter not working

Hello,

private var enemy : GameObject[];

function Start () {
	enemy = GameObject.FindGameObjectsWithTag("Enemy");
}

function Update () {

}

function OnCollisionEnter (theCollision : Collision) {
	if(theCollision.gameObject.tag == "Enemy" || theCollision.gameObject.tag == "ground") {
		Destroy(gameObject);
		Debug.Log("You hit something!");
	}
	if(theCollision.gameObject.tag == "Enemy") {
		enemy.renderer.material.color = Color.red;
	}
}

Nothing happens when the bullets hit the ground on the enemy, I have assigned the tags already, what’s wrong with this? Thanks.

Is OnCollisionEnter getting called at all? i.e. if you place this at the beginning of your OnCollisionEnter method:

function OnCollisionEnter(theCollision: Collision) {
    Debug.Log("Collided!");
    // rest of method implementation.

Does it print anything at all?

Nope, nothing happens.

Hm, how fast is the bullet moving? If it’s too fast collision wont work most of the time. Also, does your enemy and the bullet have rigidbodies attached to them?

Yes, they both have rigidbodies attached and the bullet is pretty slow, I already tried slowing it down.

I hate to ask this, but here it goes: Is the script even attached to the object. If you place a debug log in the Start method, does it print anything?

Yes, it is attached to the right object, also, the names of the objects in the enemy array are shown in the inspector.

Do the bullets have a collider component?