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?