Hey guys I keep coming across this unexpected token error and it’s doing my head in. A little help would be much appreciated.
I have two lampposts with pointlights each. tagged “Light1” and “Light2” respectively. I want Light1 to be off, but when the light intensity of Light2 becomes 0, which happens in a previous script, I want Light1 to tuen on with intensity of 2.2.
This is my script followed by my error.
#pragma strict
function Start () {
}
function Update () { //when lightoff2 script runs "light2" switches on
var "Light2" light.intensity = 0;)
if
("Light2" light.intensity == 0)
("Light1" light.intensity : float = 2.2);
}
}
Assets/Light2SwitchOn1.js(10,6): BCE0043: Unexpected token: Light2.