- Home /
Question by
Kreativity · Jul 04, 2014 at 09:47 PM ·
error
Error Code BCE0044
So I told me to put a } to end the function and I did but I got another BCE0044 saying it expected else but got } which is what it told me to put I am going crazy it is so annoying >:(
#pragma strict
private var Xpos : float;
private var Ypos : float;
private var max : boolean;
var Vert : boolean;
var maxAmount : int;
var step : float;
function Start () {
Xpos = transform.position.x;
Ypos = transform.position.y;
}
function Update () {
//SET THE MAX
if (Vert){ //Vertical movement
if(transform.position.y >= Ypos + maxAmount) {
max = true;
} else if(transform.position.y <= Ypos)
max = false;
}
} else { //Horizontal movement
if(transform.position.x >= Xpos + maxAmount) {
max = true;
} else if(transform.position.x <= Xpos)
max = false;
}
{
}
//MOVING THE PLATFORM
if(Vert){ //Vertical movement
if(!max){
transform.position.y += step;
} else {
transform.position.y -= step;
}
} else { //Horizontal movement
if (!max){
transform.position.x += step;
} else {
transform.position.x -= step;
}
}
Comment
Best Answer
Answer by Kiwasi · Jul 04, 2014 at 09:50 PM
Missing a { on line 21, 27,
Extra { on line 30,
Missing } on line 46
Give that a go.
All good. Just remember the basics, every opening bracket needs to be closed. Always start a new code block with a bracket. And don't open brackets unless you are starting a new block.
Glad he solved this for you. So you do understand why this solves the problem? Each set of braces must match!