I am having an issue with my lerping function, there are no errors. Basically, I have a normalize module that 100% works properly, however the lerping function appears to be spitting out a different alpha than the normalize function is spitting out. Basically, its finishing the lerp much faster than it should be. The goal is to attempt to tween an atmosphere property (color) between clock time’s 17 and 18. I’ve verified the normalize function is working properly by printing it out. Heres the code for the lerping function + the normalize module.
Lerping Function Area:
spawn(function()
game.Lighting.Changed:Connect(function()
game.Lighting.Atmosphere.Color = game.Lighting.Atmosphere.Color:lerp(script.ReferenceActors.AtmosphereTypes.SunsetAtmosphere.Color,NormalizeModule:Normalize(game.Lighting.ClockTime, 17, 18))
end)
end)
normalize module:
local NormalizeModule = {}
function NormalizeModule:Normalize(x, y, z)
local normalized = (x - y) / (z - y);
return normalized;
end
return NormalizeModule
I also have a script that tweens the lighting so it transitions from 17 to 18.