Hello im having a problem with some errors i get that i do not understand why im getteing. im posting a picture of my unity and my code below. this code should be able to turn on and off a torch. but i cant get it to work with the ligt.
The code is following:
//Light script on / off
var lightNr : int = 0;
var OffLight : float = 0.0;
var OnLight : float = 2.0;
private var light : GameObject;
function Start()
{
if(lightNr == 0)
{
isOn = true;
light.intensity = OnLight;
}
else
{
isOn = false;
light.intensity = OffLight;
}
}
function TurnlightOn(nr : int)
{
if(nr == lightNr)
{
isOn = true;
light.intensity = OnLight;
}
}
function TurnlightOff(nr : int)
{
if(nr == lightNr)
{
isOn = false;
light.intensity = OffLight;
}
}
¨
I hope someone can put some light in my dark why this is not working.
Thanks alot for using your time on reading my question.