Collision On Object Error. Please help.

Hello, so I put together a script that would destroy the object that has the script if it hits the player. However, the object does not break. The script is

pragma strict
    function OnCollisionEnter (hit : Collision) { 
        if( == "Player") { 

My game is 2D. The name of the player is simply Player. I am quite new to Scripting and Unity so all help is appreciated.

It sounds to me like you are wanting to see when the gameobject hits the player, not when the player hits the game object. though you’re using the player as collider.

I’ve seen problems where when the player is not moving things won’t trigger properly against its inanimate colliders… ie: if I move the player a little bit then his colliders will update and the trigger would finally happen.

I’m not an expert on collision, but like tanoshimi says, add some debugs to see when it’s happening and what it’s happening on. very common problem.