# Unity error “must have a body because it is not marked abstract, extern, or partial”

I'm trying to setup a system where I pickup an object drop it into a zone, and then the object is destroyed.

So far I have:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class TriggerZone2 : MonoBehaviour {
public Text MyText;
private int score;
public bool CompareTag(string Player);

// Use this for initialization
void Start () {
MyText.text = "";
}

// Update is called once per frame
void Update () {
MyText.text = "\$" + score;
}

void OnTriggerEnter(Collider coll) {
score = score + 1;

if (other.CompareTag ("Player")) {
Destroy (other.gameObject);
}
}
}


Everything works up until I try to destroy the game object. The console keeps saying

Assets/Scripts/TriggerZone2.cs(11,21): error CS0501: TriggerZone2.CompareTag(string)' must have a body because it is not marked abstract, extern, or partial.

I've looked up quite a few threads, but I'm still not sure what it wants me to do with it. How do I fix this?

• What is 'other'? As in the identifier; the word 'other' is used in OnTriggerEnter() but I don't see where that value is defined. – jhocking Aug 12 '15 at 20:56
• @jhocking Going by this I thought that it would delete anything, BUT the things tagged within it. I'm new to C#, and rusty on Unity though. – Sie Aug 12 '15 at 20:58
• Note that their example code defines 'other' as the parameter to the function. You called it 'coll'. – jhocking Aug 12 '15 at 21:00

In this case, I don't think you wanted to write public bool CompareTag(string Player);` I'm not sure what you're even trying to do there, but it looks unnecessary so just delete that entire line.