So I am making a realistic game, and I want the lighting to smoothly move between colors as the day goes by. Right now, the problem is that it transitions immediately. The effect it creates is also VERY unrealistic (At the first half of night, the color is sunset, at the second half, the color is night). I couldn't figure out how to tween this. Script:
local Lighting = game:GetService("Lighting")
local night, dawn, noon, sunset = 0, 6, 12, 18
local ambients = {
["Dawn"] = Color3.fromRGB(255, 180, 25),
["Day"] = Color3.fromRGB(110, 110, 110),
["Sunset"] = Color3.fromRGB(255, 140, 35),
["Night"] = Color3.fromRGB(30, 30, 50)
}
local function GetAmbient()
local ClockTime = Lighting.ClockTime
if ClockTime >= night and ClockTime <= dawn then
return ambients.Dawn
elseif ClockTime >= dawn and ClockTime <= noon then
return ambients.Day
elseif ClockTime >= noon and ClockTime <= sunset then
return ambients.Sunset
elseif ClockTime >= sunset and ClockTime <= night then
return ambients.Night
else
return ambients.Night
end
end
while true do
Lighting.ClockTime = Lighting.ClockTime + 0.1
local Ambient = GetAmbient()
print(Ambient)
Lighting.FogColor = Ambient
Lighting.ColorShift_Top = Ambient
wait()
end
Can somebody help me make this more realistic and smooth? :(
CLARITY EDIT: One instance of the issue is that sunset / rise, say, last around 1 hour - 30 minutes. In this, they last half the night XD
