This question was
closed Jun 19, 2016 at 09:43 PM by
willleo10 for the following reason:
i gave up
Primary constructor body not allowed????? i don't see whats wrong?
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;
}
}
}
Comment
$$anonymous$$y dude, just remove the semicolons at the end of lines 9 and 21.
Answer by gjf · Jun 19, 2016 at 06:02 PM
probably the extraneous semicolon on lines 9 & 21 (as posted here)