"BCE0044: expecting :, found '='" (24262)

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;
}

}

downvoted for posted the same question again

Is this person creating new accounts whenever his/her last account gets negative karma?

3 Answers

3

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

{

//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. :slight_smile:

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? :)

Yes, I missed that big and fat error!

Ha, honest above all. :)

@LAKSHAYMAVIA - I edited your post code blocks. What do you mean by "same sin speed" - you mean all your spawned objects move in similar manner? If this is the case, you'll just have to offset the time value of sin for each object.