i made this basic code and it keeps telling me that Primary constructor body not allowed and i can’t seem to fix it.
using UnityEngine;
using System.Collections;
public class buttonHIT : MonoBehaviour
{
public Text ButtText;
public GameObject trapD;
void Start ()
{
ButtText.enabled = false;
}
void OnTriggerEnter (Collider other);
{
if (other.gameObject.tag == "zone")
{
ButtText.enabled = true;
if (Input.GetKeyDown (KeyCode.p))
{
Destroy(trapD);
}
}
}
void OnTriggerExit (Collider other);
{
if (other.gameObject.tag == "zone")
{
ButtText.enabled = false;
}
}
}