I want my lighting to update in an instant when switching from day to night and the other way around
The issue is it’s not instant and you’d have to wait abit before it is actually the lighting you want
I want my lighting to update in an instant when switching from day to night and the other way around
The issue is it’s not instant and you’d have to wait abit before it is actually the lighting you want
then you need to show us the actual code that handles the lighting.
we can’t exactly look at it and receive the code information via brain waves and know exactly what’s going on.
Oh ye, here you go
local Characters = "011011100110010101110110011001010111001001100111011011110110111001101110011000010110011101101001011101100111100101101111011101010111010101110000"
Characters = string.split(Characters, "")
local TweenService = game:GetService("TweenService")
local Loads = script.Load:GetChildren()
for i, obj in pairs(Loads) do
if not game.Workspace.CurrentCamera:FindFirstChild(obj.Name) then
if obj.Name ~= "Atmosphere" and obj.Name ~= "Sky" then
obj.Parent = game.Workspace.CurrentCamera
else
obj.Parent = game.Lighting
end
end
end
game.ReplicatedStorage:WaitForChild("SwitchTime").OnClientEvent:Connect(function(Time)
if Time == "D" then
local DayComponentsAttributes = script.Components.Day
game.Workspace.CurrentCamera:WaitForChild("ColorCorrection").Brightness = DayComponentsAttributes.ColorCorrection.Brightness
game.Workspace.CurrentCamera:WaitForChild("ColorCorrection").Contrast = DayComponentsAttributes.ColorCorrection.Contrast
game.Lighting:WaitForChild("Atmosphere").Density = DayComponentsAttributes.Atmosphere.Density
game.Lighting:WaitForChild("Atmosphere").Color = DayComponentsAttributes.Atmosphere.Color
game.Lighting:WaitForChild("Atmosphere").Decay = DayComponentsAttributes.Atmosphere.Decay
game.Lighting:WaitForChild("Atmosphere").Glare = DayComponentsAttributes.Atmosphere.Glare
game.Lighting:WaitForChild("Atmosphere").Haze = DayComponentsAttributes.Atmosphere.Haze
game.Lighting:WaitForChild("Sky").SkyboxBk = DayComponentsAttributes.Sky.SkyboxBk
game.Lighting:WaitForChild("Sky").SkyboxDn = DayComponentsAttributes.Sky.SkyboxDn
game.Lighting:WaitForChild("Sky").SkyboxFt = DayComponentsAttributes.Sky.SkyboxFt
game.Lighting:WaitForChild("Sky").SkyboxLf = DayComponentsAttributes.Sky.SkyboxLf
game.Lighting:WaitForChild("Sky").SkyboxRt = DayComponentsAttributes.Sky.SkyboxRt
game.Lighting:WaitForChild("Sky").SkyboxUp = DayComponentsAttributes.Sky.SkyboxUp
local DayAttributes = script.Attributes.Day
game.Lighting.Ambient = DayAttributes.Ambient.Value
game.Lighting.Brightness = DayAttributes.Brightness.Value
game.Lighting.ColorShift_Bottom = DayAttributes.CSBottom.Value
game.Lighting.ColorShift_Top = DayAttributes.CSTop.Value
game.Lighting.EnvironmentDiffuseScale = DayAttributes.EDiffusion.Value
game.Lighting.EnvironmentSpecularScale = DayAttributes.ESpeculation.Value
game.Lighting.OutdoorAmbient = DayAttributes.OutDoorAmbient.Value
game.Lighting.ShadowSoftness = DayAttributes.ShadowSoftness.Value
game.Lighting.ClockTime = DayAttributes.ClockTime.Value
game.Lighting.GeographicLatitude = DayAttributes.GeographicalLatitude.Value
if not script.Parent.Parent.DeathScreen.IsDead.Value then
script.Parent.Day.Value += 1
end
if game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("DeathScreen"):WaitForChild("IsDead").Value == false then
script.DaySwitch:Play()
end
script.Parent.DayOverlay.Flash.ImageTransparency = 0
wait()
script.Parent.DayOverlay.TextTransparency = 0.5
script.Parent.DayOverlay.TextStrokeTransparency = 0.9
script.Parent.DayOverlay.Count.TextTransparency = 0.35
script.Parent.DayOverlay.Count.TextStrokeTransparency = 0.9
script.Parent.DayOverlay.Bar.BackgroundTransparency = 0.65
local DayName = game.Workspace.DayName.Value
local RandomDayNameString = ""
local OldIndex
for i = 1, #DayName do
local Index = math.random(1, #Characters)
if OldIndex then
while Index == OldIndex do
Index = math.random(1, #Characters)
end
end
RandomDayNameString = RandomDayNameString.. Characters[Index]
OldIndex = Index
end
script.Parent.DayOverlay.Text = RandomDayNameString
local DayNumber
if script.Parent.Day.Value > 1 then
DayNumber = "I t h a s b e e n ".. script.Parent.Day.Value.. " d a y s s i n c e y o u r a r r i v a l"
else
DayNumber = "I t h a s b e e n ".. script.Parent.Day.Value.. " d a y s i n c e y o u r a r r i v a l"
end
local RandomDayNumberString = ""
OldIndex = nil
for i = 1, #DayNumber do
local Index = math.random(1, #Characters)
if OldIndex then
while Index == OldIndex do
Index = math.random(1, #Characters)
end
end
RandomDayNumberString = RandomDayNumberString.. Characters[Index]
OldIndex = Index
end
script.Parent.DayOverlay.Count.Text = RandomDayNumberString
local GeneralTweenInfo = TweenInfo.new(4, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
local FlashTween = TweenService:Create(script.Parent.DayOverlay.Flash, GeneralTweenInfo, {ImageTransparency = 1})
FlashTween:Play()
local ShadeTween = TweenService:Create(script.Parent.Shade, TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0), {ImageTransparency = 0.65})
ShadeTween:Play()
wait(0.5)
local RandomDayNameStringChracters = string.split(RandomDayNameString, "")
for i = 1, #DayName do
local ReplacementCharacter = string.split(DayName, "")[i]
RandomDayNameStringChracters[i] = ReplacementCharacter
local RenderedText = table.concat(RandomDayNameStringChracters)
RandomDayNameString = RenderedText
script.Parent.DayOverlay.Text = RenderedText
wait(0.25)
end
wait(0.1)
local RandomDayNumberStringChracters = string.split(RandomDayNumberString, "")
local IndexChracterList = string.split(DayNumber, "")
for i = 1, #DayNumber do
local RandomIndex = math.random(1, #IndexChracterList)
while IndexChracterList[RandomIndex] == "~" do
RandomIndex = math.random(1, #IndexChracterList)
end
RandomDayNumberStringChracters[RandomIndex] = IndexChracterList[RandomIndex]
local RenderedText = table.concat(RandomDayNumberStringChracters)
IndexChracterList[RandomIndex] = "~"
RandomDayNumberStringChracters = string.split(RenderedText, "")
script.Parent.DayOverlay.Count.Text = RenderedText
task.wait()
end
--script.Parent.DayOverlay.Text = DayName
--script.Parent.DayOverlay.Count.Text = DayNumber
wait(1)
local DayNameOverlayTween = TweenService:Create(script.Parent.DayOverlay, GeneralTweenInfo, {TextTransparency = 1, TextStrokeTransparency = 1})
local DayCountTween = TweenService:Create(script.Parent.DayOverlay.Count, GeneralTweenInfo, {TextTransparency = 1, TextStrokeTransparency = 1})
local BarTween = TweenService:Create(script.Parent.DayOverlay.Bar, GeneralTweenInfo, {BackgroundTransparency = 1})
local ShadeTween = TweenService:Create(script.Parent.Shade, GeneralTweenInfo, {ImageTransparency = 1})
DayNameOverlayTween:Play()
DayCountTween:Play()
BarTween:Play()
ShadeTween:Play()
else
local NightComponentsAttributes = script.Components.Night
game.Workspace.CurrentCamera:WaitForChild("ColorCorrection").Brightness = NightComponentsAttributes.ColorCorrection.Brightness
game.Workspace.CurrentCamera:WaitForChild("ColorCorrection").Contrast = NightComponentsAttributes.ColorCorrection.Contrast
game.Lighting:WaitForChild("Atmosphere").Density = NightComponentsAttributes.Atmosphere.Density
game.Lighting:WaitForChild("Atmosphere").Color = NightComponentsAttributes.Atmosphere.Color
game.Lighting:WaitForChild("Atmosphere").Decay = NightComponentsAttributes.Atmosphere.Decay
game.Lighting:WaitForChild("Atmosphere").Glare = NightComponentsAttributes.Atmosphere.Glare
game.Lighting:WaitForChild("Atmosphere").Haze = NightComponentsAttributes.Atmosphere.Haze
game.Lighting:WaitForChild("Sky").SkyboxBk = NightComponentsAttributes.Sky.SkyboxBk
game.Lighting:WaitForChild("Sky").SkyboxDn = NightComponentsAttributes.Sky.SkyboxDn
game.Lighting:WaitForChild("Sky").SkyboxFt = NightComponentsAttributes.Sky.SkyboxFt
game.Lighting:WaitForChild("Sky").SkyboxLf = NightComponentsAttributes.Sky.SkyboxLf
game.Lighting:WaitForChild("Sky").SkyboxRt = NightComponentsAttributes.Sky.SkyboxRt
game.Lighting:WaitForChild("Sky").SkyboxUp = NightComponentsAttributes.Sky.SkyboxUp
local NightAttributes = script.Attributes.Night
game.Lighting.Ambient = NightAttributes.Ambient.Value
game.Lighting.Brightness = NightAttributes.Brightness.Value
game.Lighting.ColorShift_Bottom = NightAttributes.CSBottom.Value
game.Lighting.ColorShift_Top = NightAttributes.CSTop.Value
game.Lighting.EnvironmentDiffuseScale = NightAttributes.EDiffusion.Value
game.Lighting.EnvironmentSpecularScale = NightAttributes.ESpeculation.Value
game.Lighting.OutdoorAmbient = NightAttributes.OutDoorAmbient.Value
game.Lighting.ShadowSoftness = NightAttributes.ShadowSoftness.Value
game.Lighting.ClockTime = NightAttributes.ClockTime.Value
game.Lighting.GeographicLatitude = NightAttributes.GeographicalLatitude.Value
if game.Players.LocalPlayer:FindFirstChild("PlayerGui"):FindFirstChild("DeathScreen"):FindFirstChild("IsDead").Value == false then
script.DaySwitch:Play()
script.NightBegin:Play()
script.NightBegin.Volume = script.NightBegin.InitialVolume.Value
script.NightBegin:Play()
local VolumeTween = TweenService:Create(script.NightBegin, TweenInfo.new(11.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0), {Volume = 0})
VolumeTween:Play()
end
end
end)
Is there any physical Light objects or you’re just adjusting the Lighting settings?
I adjust the Lighitng properties, the Atmosphere, the Sky, and the ColorCorrection
that’s pretty much it
You can’t change lighting instanly, because of roblox engine, it’s impossible sadly
:( ok then, wait but then how did the game 3008 do it instantly?
brightness, when lighting changed brightness is lowered to 0, and then slowly going to normal
try to do that
Alright, within’ workspace properties try enabling StreamingEnabled.
If that doesn’t work, then you could try adding a delay to changing the skybox so the Lighting changes are done first then it waits like half a second then switches Skybox then you carefully adjust the wait until it looks good.
Those are actually really good ideas, I’ll try them
i’ve got an idea, make atmosphere change smoothly, but still fast, rather then instanly, should help, or just as i said, make brighness to zero when you want to change sky/fog/atmosphere just anything in lighting that can’t be changed instanly