Ok, this is probably really simple, but I’m having a hard time with it, I have a cube set up that tracks and chases my player and I have this code on my player so that when the cube hits it, my characters health will go down, I put in the Debug.Log’s to try and figure out why OnCollisionEnter wasn’t getting called, I still haven’t figured it out, for some reason it’s not being called, I have a box collider on my player and a box collider on my enemy, my enemy is tagged “Enemy” and everything, is there something wrong with my code? Thanks
var health = 100;
function OnCollisonEnter(collision : Collision) {
Debug.Log("hit");
if (collison.gameObject.tag == "Enemy"){
Debug.Log("enemy");
health --;
print(health);
}
}