- Home /
Can someone help me with the Eof error thing? dfggdfgfhh
Near the bottom it says else {. I get an error and when i look at the Jimmy Vegas video his is correct and mine is wrong.
import UnityEngine.UI;
var TextBoxOnCheck : int = 0; var MessageBox : GameObject; var TextBox : GameObject; var TextMessage : String; var QuestBox : GameObject; var QuestText : GameObject; var QuestName : String;
function OnMouseDown () { if (TextBoxOnCheck == 0) TextBoxOnCheck = 1; MessageBox.SetActive(true); TextBox.GetComponet.().text = TextMessage; QuestName = "Active Quest: 'Recover The Loot'"; QuestText.GetComponent.().text = QuestName; }
else {
TextBoxOnCheck = 0;
MessageBox.SetActive(false);
TextMessage = "Villager: Get going then!";
}
}
Excuse me, what? Who is Jimmy Vegas? What video? "dfggdfgfhh"...?
And please fix the code formatting.
You can read my answer below, but please be more polite next time you ask other people for help.
Answer by aurelioprovedo · Oct 31, 2017 at 05:36 PM
You are missing a "{" after the if statement. Try this:
function OnMouseDown ()
{
if (TextBoxOnCheck == 0)
{
TextBoxOnCheck = 1;
MessageBox.SetActive(true);
TextBox.GetComponet.().text = TextMessage;
QuestName = "Active Quest: 'Recover The Loot'";
QuestText.GetComponent.().text = QuestName;
}
else
{
TextBoxOnCheck = 0;
MessageBox.SetActive(false);
TextMessage = "Villager: Get going then!";
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612142257im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Play Animation if Sound Output 0 Answers
OpenCV Sharp and Unity help (making detected facial features interactive) 1 Answer
MI GAME CRASH WHEN I TRY TO PLAY IT 1 Answer
how to get a window bigger than screen 0 Answers
computer to ipod 1 Answer