I am trying to tween the lighting's ColorShift_Top seamlessly while also making time go by. I made this script:
local Glows = {
["Morning_Glow"] = Color3.fromRGB(255, 140, 35),
["Noon_Glow"] = Color3.fromRGB(255, 255, 125),
["Evening_Glow"] = Color3.fromRGB(175, 45, 5),
["Night_Glow"] = Color3.fromRGB(15, 20, 75)
}
local function GetGlow()
local CT = Lighting.ClockTime
if CT > 6 and CT <= 8 then
return Glows.Morning_Glow
elseif CT > 8 and CT <= 16 then
return Glows.Noon_Glow
elseif CT > 16 and CT <= 18 then
return Glows.Evening_Glow
else
return(Glows.Night_Glow)
end
end
while true do
Lighting.ClockTime = Lighting.ClockTime + increment
local Ambient = Lighting.ColorShift_Top
local NewAmbient = GetGlow()
if Ambient == NewAmbient then
Lighting.ColorShift_Top = NewAmbient
else
local newTween = TS:Create(Lighting, TI, {ColorShift_Top = NewAmbient})
newTween:Play()
end
wait()
end
(Some parts not included.)
But when it tweens, it is vey slow. I know this is due to tweens overlapping, but how can I fix this? I need the tween to play in the "Background," with the rest of the script still running.
EDIT: The tweeninfo is:
TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.In)

1 comment
You deserve an upvote mate.