Basically I have a Model Sun and Moon and their meant to follow the direction of sun and moon in roblox but it doesn’t work. Any idea why?
Local Script:
local SOLAR_DIST = 512
local sun = workspace:WaitForChild("Sun")
local moon = workspace:WaitForChild("Moon")
local Lighting = game:GetService("Lighting")
local function updateSunAndMoon()
local sDir = Lighting:GetSunDirection()
local mDir = Lighting:GetMoonDirection()
local origin = CFrame.new(workspace.CurrentCamera.CFrame.Position)
sun:PivotTo(origin + SOLAR_DIST * sDir)
moon:PivotTo(origin + SOLAR_DIST * mDir)
end