OnCollisionEnter JavaScript Problem

I’m in a very simple script, and i got a problem with collision:

When the object collide with the player, it will be destroyed. And the problem was: The object have box collider and rigid body, so it is in the ground. When the player collides, the object do not detect the collision with the player, because it is in a collision with the ground (i think ). I tried to let the object fall in the player head, and it worked.

Here is the Script:

function Start () {
}
function Update () {
}
function OnCollisionEnter (collision: Collision)
{
if (collision.gameObject.tag ==“Player”)
{
Destroy(gameObject);
}
}

Thank you for the attention, and sorry for my bad english.

Did you try to add a rigid body on the player?
You also have the option to check your option “Trigger” on your box collider.

Also you should use the code tags to show your code.
http://forum.unity3d.com/threads/143875-Using-code-tags-properly

And on a side note, you don’t need to have empty methods / functions. Apparently they are still used even if empty. So Update would still waste some process even if empty.

Hope that helps a bit…

how are you moving the player?