Clocktime issue

I have this technical issue with lighting, where there lighting has a tendency, after Clocktime 19.3 to become extremely bright at night.


I have code that cycles through Clocktime to imitate day and night. I was wondering if this is a technical limitation or a bug.

-- code in question

local dayLength = 25

local cycleTime = dayLength*60
local minutesInADay = 24*60

local lighting = game:GetService("Lighting")

local startTime = tick() - (lighting:getMinutesAfterMidnight() / minutesInADay)*cycleTime
local endTime = startTime + cycleTime

local timeRatio = minutesInADay / cycleTime

if dayLength == 0 then
	dayLength = 1
end

repeat
	local currentTime = tick()
	
	if currentTime > endTime then
		startTime = endTime
		endTime = startTime + cycleTime
	end
	
	lighting:setMinutesAfterMidnight((currentTime - startTime)*timeRatio)
	wait(1/15)
until false
 
 

You have to mess around with some of the Lighting.Appearance properties.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.