Whenever we’re changing the TimeOfDay tween slowly it seems to be doing in “ticks” and turns out pretty choppy, when you speed it up it’s pretty smooth and we don’t know any methods that we could try which wouldn’t require us to use the client as that would make it desync.
Methods we tried:
local Lighting = game:GetService"Lighting"
local TweenService = game:GetService"TweenService"
TweenService:Create(Lighting,TweenInfo.new(24--[[adjust the time]],Enum.EasingStyle.Linear,Enum.EasingDirection.Out,math.huge,true,0),{
ClockTime = 24
})
Looped Version:
local Lighting = game:GetService"Lighting"
local RunService = game:GetService"RunService"
while true do
Lighting.ClockTime = Lighting.ClockTime + RunService.Heartbeat:Wait()/25
end
Another Method:
while true do
wait(10) -- Or whatever time, I used this for testing purposes.
for i = 1,100 do
local Time = game.Lighting
Time.ClockTime = Time.ClockTime + .01
wait(.01)
end
end
Well, first of all wait can only go to 1/30th of a second, and is choppy in itself, so I would recommend task.wait(). Also, this should be a bit better?
while true do
task.wait(10) -- Or whatever time, I used this for testing purposes.
for i = 1,100 do
local a = task.wait()
local Time = game.Lighting
Time.ClockTime += a
end
end
wait() tends to throttle, which makes things look choppy. Also, task.wait() can go as low as 1/60th of a second, doesn’t throttle, and returns how much time has passed, which allows me to add it to the clock time. If you want it to be an even number however, I would instead just add 0.01.
while true do
task.wait(10) -- Or whatever time, I used this for testing purposes.
for i = 1,100 do
local Time = game.Lighting
Time.ClockTime += 0.01
task.wait()
end
end
local Game = game
local Lighting = Game:GetService("Lighting")
local TweenService = Game:GetService("TweenService")
Lighting.ClockTime = 0
local Tween = TweenService:Create(Lighting,TweenInfo.new(48, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1), {ClockTime = 24}) --Increase 48 for a longer (smoother) transition.
Tween:Play()
I’d also recommend performing tweens on the client instead of on the server.
Change to softer shadows, either by increasing Lighting’s ShadowSoftness or changing Lighting’s Technology to something softer, such as Voxel. With softer shadows, there’s not so many choppy pixels being rendered (especially in the grass) and a smooth transition looks a lot better