OnColliderEnter doesn't work for me

I want to make the first person controller touch the ammo box and then a GUI appears up, but when I use onColliderEnter, it won’t even work, I have set up the tag and everything but I don’t know why it’s not working…

Here is my code

using UnityEngine;
using System.Collections;

public class NewBehaviourScript : MonoBehaviour {
	
	bool Message = false;

	// Use this for initialization
	void Start () {
	}
	
	// Update is called once per frame
	void Update () {
		
	
	}
	
    void OnColliderEnter (Collider enemy)
{
		Debug.Log("AmmoBox colliding");
        if (enemy.collider.tag == "krat")
		{
			Debug.Log("Collision detected");
		}
}
	
	void OnGUI(){
		
		if (Message == true)
		{
			GUI.Box(new Rect(20,20, 100, 30), "debug");	
		}
		
	}
	
}

its not OnColliderEnter, its OnCollisionEnter,

dont feel bad i had the same problem all weekend, i felt like a moron today

  1. Does have your gameObject collider ?
  2. Did you check isTrigger control?
  3. void OnColliderEnter (Collider enemy) => NOT TRUE

This is for Trigger
void OnTriggerEnter(Collider other) {

Destroy(other.gameObject);

}

OTHER WAY:

If you want to use collision;

1.Add collider

2.You must UNcheck isTrigger control of collider.

3.Add rigidbody

void OnCollisionEnter(Collision collision) {

Destroy(collision.gameObject)

}

check out is your character and collider both have rigid bodies with iskinematics mark option it will help you to collision.