Trying to figure out how to detect when the player hits a spike

I used rigid body on the player with rotation locked and the spike is a box with boxcollider attached and this is a 2D game if that matters, I’ve google’d it found some threads with similar questions but the shit wasnt working at all please help me.

use a trigger collider and put into script OnTriggerEnter .

Hi, you can use bounds.Intersects.Like the following;

var playerBounds : Bounds;
var spikeBounds : Bounds;
var player : Transform;
var spike : Transform;

function Start ()
{
playerBounds = player.collider.bounds;
spikeBounds = spike.collider.bounds;
}

function Update ()
{
     if(playerBounds.Intersects(spikeBounds))
     {
     //You hit it!
     }
}