- Home /
Item Scripting Error
Assets/cube.js(27,45): BCE0044: expecting :, found '='.
var details : boolean = false;
var detaillistActive : boolean = false;
var pickup : boolean = false;
var dropdetails : boolean = false;
var tunnelwidth = 500;
var tunnelheight = 200;
var tunnel1 = 100;
var tunnel2 = 30;
var law = 500;
var lah = 230;
var size = 100;
var size1 = 25;
var pickw = 500;
var pickh = 255;
var picksize = 100;
var picksize1 = 25;
var Cube : gameObject;
function OnGUI ()
{
if (details)
{
if (GUI.Button(Rect(tunnelwidth, tunnelheight, tunnel1, tunnel2), "Cube"));
{
//error is here
detaillistActive = !detaillistActive;
}
if(detaillistActive)
{
GUI.Box(Rect(law, lah, size, size1), "Cube");
if (GUI.Button(Rect(pickw, pickh, picksize, picksize1), "Pick-up"));
{
pickup = !pickup;
}
}
}
if(pickup)
{
(GUI.Button(Rect(100, 100, 75, 25),"Cube"));
details = false;
}
if (pickup)
{
Destroy (Cube);
}
}
function OnTriggerEnter(other : Collider)
{
if(other.tag == "Player")
{
details = true;
}
}
function OnTriggerExit(other: Collider)
{
if(other.tag == "Player")
{
details = false;
}
}
Comment
Best Answer
Answer by YoungDeveloper · Oct 16, 2013 at 05:41 PM
You don't need semicolon after if()
if (GUI.Button(Rect(tunnelwidth, tunnelheight, tunnel1, tunnel2), "Cube"));
{
should be
if (GUI.Button(Rect(tunnelwidth, tunnelheight, tunnel1, tunnel2), "Cube"))
{
It's an obvious mistake. I'll tell you the answer for 5% of your profits ;)
btw u were right but it was in more then 1 spot but it helped me find it thanks man
Answer by darkal · Oct 17, 2013 at 07:53 PM
i solved it
That's not an answer. If you solved it, perhaps post your solution so a future Unity community person can see your solution.
well i was the person who asked the question so theres not much point in sharing it if i solved it even more so seeing as i wanna make a profit off of it lmao
With that attitude good luck getting anyone else to make your profit for you...
From UA FAQ )