Checking to see if two objects are colliding.

When I destroy an enemy, it drops a health box meant to restore the health of a player.
I am trying to get it to where if the player comes in contact with the health box, the box gets destroyed. this is the code I have so far but it doesn’t seem to be updating because I’m not getting the log in my console.

var healthDrop : Transform;

function OnCollisionEnter (col : Collision)
    {
    	Debug.Log("activated");
    	if (col.collider.tag == "healthDrop")
    	{
    		Destroy(healthDrop);
    	}
    }

Review CharacterController

I honestly can’t see anything wrong with this. Try adding something to it for example :

var Collider = false;
var HealthDrop : Transform;

function OnTriggerEnter(){

Collider = true;

}

Function update(){

If ( Collider == true ){
  Debug.Log("Activated");
     Destroy(HealthDrop);
}
}

I’m guessing nor hoping that this would work or give you an idea. Hope this helped ! And good luck :slight_smile: