I recently started making a new game and I'm kinda an amateur coder.
var FlashlightOn : boolean = true;
function Update () {
ButtonClicket();
}
function ButtonClicket () {
if (Input.GetButton("Flashlight")) && FlashlightOn == true {
Destroy(Flahslight);
FlashlightOn = false;
}
else
{
Instantiate (Flashlight, Vector3(i * 0, 0, 0), Quaternion.identity);
FlashlightOn = true;
}
}
In the compiler error part it says I need to put brackets at the end and some other junk that doesn't need to be done. What am I doing wrong here?
UnityandJavaScriptreally belong on Stackoverflow. I have already flagged this question for migration. - Security Houndnewkeyword. - George Mauer