#pragma strict
private var LightState : String = "Off";
function Start(){
light.intensity = 0.0;
}
function Update () {
if(GC.hour > 17.5){
if(LightState == "Off"){
light.intensity = Mathf.Lerp(0.0,1.0,5.0); <---------------------
if(light.intensity == 1.0){
LightState = "On";
}
}
}
if(GC.hour > 5.5 && GC.hour < 15.5){
if(LightState == "On"){
light.intensity = Mathf.Lerp(1.0,0.0,5.0); <---------------------
if(light.intensity == 0.0){
LightState = "Off";
}
}
}
}
What gives?
It must be something I don’t know about as I can’t be much different from the script reference. I thought this was a simple function but it’s not performing as expected. ~Confused~