OnTriggerEnter issue

function OnTriggerEnter (col : Collider) {

if(col.gameObject.tag == "Spell")
{
	Debug.Log("Hit");
	Destroy(this.gameObject);
}

}

Every time I set that up, and every time I send an object that is tagger appropriately, nothing happens. Not even the Debug… can anybody tell me what I’m doing wrong?

try altering the if statement to:

if (col.gameObject.transform.tag == "Spell")
{
    Debug.Log("Hit");
    Destroy(this.gameObject);
}

Also worth double checking the tag is “Spell” and not “spell” or some variation

You could also remove the if statement and debug ANY object that enters the trigger. You can then use the tag in the debug to do what you want like so:

function OnTriggerEnter(col : Collider)
{
    Debug.Log(col.gameObject.transform.tag);
    Debug.Log(col.gameObject.transform.name);
}