So I am doing a flashlight for my game, and I want the feature to toggle the light on and off. But I get Error BCE0077 : It is not possible to invoke a expression of type ‘boolean’. My question is: what is wrong with my script? Have I done something wrong here?
Here’s my script :
var LightObj : GameObject;
var Status = true;
function Update () {
if(Input.GetKeyDown("f")){
if(Status == true){
Status == false();
}
else
if(Status == false){
Status == true();
}
}
}
function CheckStatus () {
if(Status == true){
LightObj.Light.enabled = true;
}
else
if(Status == false){
LightObj.Light.enabled = false;
}
}
Did my answers help at all? Note, it's considered common courtesy to vote up a helpful answer, and/or mark an answer as the answer if you asked the question.
– Keith1024