- Home /
Question by
cidmodder · Jan 23, 2011 at 06:20 PM ·
javascripterrorbce0044
function in a function error
everytime I try to get a funtion inside a function i get this error on the second function no matter which order I put them in. "(#,#) expecting ( found whatever" Why is that? Here's one of the scripts i'm having this problem
function OnGUI(){ GUI.Box(Rect(10,10,150,100), "Press E to enter turret");
function OnMouseOver() {
Debug.Log ("computer here");
}
}
and my error is (4,10): BCE0044: expecting (, found 'OnMouseOver'.
Comment
Best Answer
Answer by Jessy · Jan 23, 2011 at 06:28 PM
Functions declarations can not be inside function declarations; it's really that simple.
If there's something you're trying to do, which, by your logic, would necessitate it, edit the question to name that, and we can give you a solution that will compile.