I have 5 errors on a script i checked There wasnt these eroors what should i do my text: import UnityEngine.UI; var TheDistance : float = PlayerCasting.DistanceFromTarget; var TextDisplay : GameObject; var TheDoor : GameObject; function Update () { TheDistance = PlayerCasting.DistanceFromTarget; if (input.GetButtonDown("Action")){ if (TheDistance <= 2) { } function OnMouseOver () { if (TheDistance <= 2) { TextDisplay.GetComponent.<Text>().text = "Press Button"; } } function OnMouseExit () { TextDisplay.GetComponent.<Text>().text = ""; } my errors: Expecting (, found 'OnMouseOver Expecting semicolon at the end x2 expecting ( found 'OnMouseExit' expecting } found ''. Plz help
In your update method, what is the if check that checks for distance <= 2 doing there? You don't have any code following it. And you only have one curly brace '{', which is causing the error. For your OnMouseExit, a semicolon does not go after the opening curly brace. I would suggest reading up on the basic syntax for UnityScript to help yourself understand these things better.
Please use code tags when posting code. Also use a more descriptive title in the future. "ERRORS!!!!" doesn't tell me anything about your issue. I don't see what this problem has to do with Unity Documentation... As for your errors, delete these two lines as they aren't doing anything and don't have corresponding ending braces. Code (csharp): if (input.GetButtonDown("Action")){ if (TheDistance <= 2) {