Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Sun is supposed to move around but stays in sky?

Asked by 2 years ago

Hi, I wrote some code and it is supposed to move the sun and its for a game where i want an interactive day night cycle, but instead, the sun stays in place in the sky. Here's the code:

dayTime = 300
interval = 24 / dayTime
while wait(1) do
    game.Lighting.ClockTime += interval
end

1 answer

Log in to vote
0
Answered by 2 years ago

Hi, put this script in serverscriptservice Script:

local Time = 0.01 --feel free to play with the numbers to set how you want it
local TimeChange = 0.01 --feel free to play with the numbers to set how you want it
while wait(Time) do
game.Lighting.ClockTime = game.Lighting.ClockTime + TimeChange
end
0
Thank you, the sun now moves. MrBucketOfficial 39 — 2y
0
No problem theking66hayday 841 — 2y
0
Happy to help theking66hayday 841 — 2y
Ad

Answer this question