- Home /
Question by
mirkobon · Aug 21, 2013 at 06:19 AM ·
errorerror-message
Error in my Greade script.
I started my grenade script when i got these errors. Assets/scripts/Grenade.js(18.27)BCE0044:expecting ), found '=' Assets/scripts/Grenade.js(18.29)BCE0043:unexpected token: false Assets/scripts/Grenade.js(21.27)BCE0044:expecting :, found '='
I guess they have to do something with {
} here is my code:
var grenadeActive : boolean = false;
function Start () {
}
function Update ()
{
if (Input.GetKey(KeyCode.G))
Grenade();
}
function Grenade(){
if (grenadeActive = false)
{
gameObject.active = true;
grenadeActive = true;
} else {
gameObject.active = false;
grenadeActive = false;
}
}
can someone please help me? if you need more information say it please.
Comment
Best Answer
Answer by whydoidoit · Aug 21, 2013 at 06:19 AM
You test for equality with == not = (which is assignment)