I’m having some trouble with OnCollisionEnter. There’s a thing that’s spitting projectiles at the player, and if the player gets hit by a projectile, he dies. I’ve coded it so that anything with the tag of “Enemy” will kill the player. I’ve added the Enemy tag to the projectile, but it doesn’t kill the player!
Here’s some screenshots and code of what’s going on:
This is the inspector for the projectile I want to collide with the player:
This is the inspector for the player that I want the projectile to collide into:
This is the code that detects the collision between the projectile and the player, then kills the player. It’s attached to the player, BTW:
function OnCollisionEnter(death:Collision)
{
Debug.Log("Collide with thing");
if(death.gameObject.tag == "Enemy")
{
Debug.Log("DIE");
Application.LoadLevel("dead");
}
}
“Collide with thing” doesn’t print to the console when the player collides with the projectile…
My frustration level is over 9000 right now, I can’t figure this out. This seems like it would be super duper simple, but it’s just NOT working for whatever reason.

