- Home /
BCE0044: expecting :, found '='
BCE0044: expecting :, found '=' is an error that I can't find the answer to. I was wondering if you guys could look over and see?
{
//we're hit! Spin our character around
transform.Rotate(0,tumbleSpeed * Time.deltaTime,0, Space.World);
tumbleSpeed = tumbleSpeed-decreaseTime;
decreaseTime += decayTime;
}
} function (hit : ControllerColliderHit) //onTriggerEnter : collider {
if(hit.gameObject.tag == "fallout");
{ dead = true; //the error is on this line, please help!
//subtract life here
HealthControl.LIVES -= 1;
}
if(hit.gameObject.tag == "enemyProjectile")
{
gotHit = true;
}
}
Is this person creating new accounts whenever his/her last account gets negative karma?
Answer by kop4 · Jul 02, 2011 at 03:53 PM
On this line (above the error line)
if(hit.gameObject.tag == "fallout");
There shouldn't be a semicolon at the end.
ps. when you post code, format it using the button with the ones and zeros to make it easy to read
Answer by FLASHDENMARK · Jul 02, 2011 at 03:53 PM
{
//we're hit! Spin our character around
transform.Rotate(0,tumbleSpeed * Time.deltaTime,0, Space.World);
tumbleSpeed = tumbleSpeed-decreaseTime;
decreaseTime += decayTime;
}
}
function OnControllerColliderHit (hit : ControllerColliderHit) {
if(hit.gameObject.tag == "fallout")
{ dead = true; //the error is on this line, please help!
//subtract life here
HealthControl.LIVES -= 1;
}
if(hit.gameObject.tag == "enemyProjectile")
{
gotHit = true;
}
}
That should do the trick. :)
Hmmm.. I tried all of these, and the same error is still there, plus a couple new errors... Should I try re-scripting it?
I would post my script but I can't get to it right now... I'll do it later
Answer by aldonaletto · Jul 02, 2011 at 03:56 PM
It's a sintax error. The problem is one line above:
if(hit.gameObject.tag == "fallout"); <- remove this ";"
What about: function (hit : ControllerColliderHit) That is not a function. He forgot OnControllerColliderHit. Or am I wrong? :)
Your answer
Follow this Question
Related Questions
FPS Script Error OnCollisonEnter 1 Answer
Unity MoveAround error 1 Answer
Unity3d C to Javascript conversion? 1 Answer
(10,47): BCE0044: expecting :, found '='. 2 Answers
Formatting problems in Script 2 Answers