Is Trigger Collider failing to activate OnCollisionEnter function

Hello. I am allowing the player to drop mines on the floor. When another player gets near them (It has a 100 radius sphere collider right now), it should just say “here” in the output window. However when I get close to it, it fails to get to the function.

function OnCollisionEnter(theCollission:Collision) {
Debug.Log(“here”);
}

I tried unchecking the “istrigger” option to see if the collision works at all, and it acts like a wall to my player as it normally should. I have absolutely no idea what I’m doing wrong, please help, thanks.

1 Answer

1

Make the sphere collider on the mine a trigger then put a script on it for

function OnTriggerEnter (myTrigger : Collider) 
{

     if(myTrigger.gameObject.tag == "Player")
     {
      Debug.Log("Blew up the Player!");
     }
}

the fact that you said you unchecked the is trigger makes me think you had it originally but you are using an OnCollisionEnter instead of OnTriggerEnter.

My best guess, hope it helps.