Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local SOLAR_DIST = 512
- local sun = workspace.SunDude
- local moon = workspace.Moonette
- --Call this function either every frame or every time the ClockTime changes
- local function updateSunAndMoon()
- local sDir = game.Lighting:GetSunDirection()
- local mDir = game.Lighting:GetMoonDirection()
- local origin = CFrame.new(workspace.CurrentCamera.CFrame.Position)
- sun:PivotTo(origin + SOLAR_DIST * sDir)
- moon:PivotTo(origin + SOLAR_DIST * mDir)
- end
- updateSunAndMoon()
Advertisement
Add Comment
Please, Sign In to add comment