Determine realistic sunset, etc. time from game info

I want to calculate the in-game time for sunset, sunrise, solar noon, lunar noon, lunar phase? based on information about the player’s in-game location like solar latitude, altitude, etc.

immagine

I already rotate a sun dial using in-game timeofday. It would be cool to do all the time calculations in-game too (the numbers in the screenshots need to be calculated)

Here’s what I use for the sun dial:

self["Dial"]["Sun"].Rotation = ((Lighting:GetMinutesAfterMidnight() / 1440) * 360) + 270
1 Like
while true do
	game.Lighting:setMinutesAfterMidnight(math.fmod(tick() + 3680*3680 + -9*3,60*60*24)/60)
	wait(0.1)
end

the sun in roblox always starts rising at 5 o’ clock and setting at 19 o’ clock, no matter the latitude.
and the moons position is always opposite of the sun so you cant really calculate its phase since its always a full moon, unless what you are trying to do is calculate the real life suns position and moon phase?

1 Like

Hey how do i get a roblox script to read real life time

1 Like