hi hoping for some help here
I’m working on some time cycle code
if ((hoursInt >= keyTime3) && (hoursInt <= keyTime4)) {
currentDLcolor = DLcolor3;
currentDLintensity = DLintensity3;
targetDLcolor = DLcolor4;
targetDLintensity = DLintensity4;
timeToNextKey = (keyTime3 - keyTime2) - (((float)hours%24) - keyTime3);
actualDLintensity = Mathf.Lerp(DLintensity3, DLintensity4, timeToNextKey * Time.deltaTime);
actualDLcolor = Color.Lerp(DLcolor3, DLcolor4, timeToNextKey * Time.deltaTime);
to lerp the main light colours and intensities between defined key times of day
i got it working when it was simpler now I’ve made it more complex (it works out the time between keys automatically) it just flips to the next value, not sure where i went wrong and can’t remember how i had it before when it was simpler
cheers
Owen