When SkyBox.CelestialBodiesShown = false, the game still displays sunrays as if SkyBox.CelestialBodiesShown = true. Expected behavior is that sunrays are hidden if the sun is hidden through Skybox.CelestialBodiesShown = false.
If you want to sync the sun rays visibility to the celestial body property, here’s how you could do it:
local sky = game:GetService("Lighting").Sky
local sunRays = game:GetService("Lighting").SunRays
local function Update()
sunRays.Enabled = sky.CelestialBodiesShown
end
sky:GetPropertyChangedSignal("CelestialBodiesShown"):Connect(Update)
Update()
This. I have used skyboxes with a sun already in it and use the Sunrays effect with CelestialBodiesShown disabled and I believe having this be a possibility is a lot better than having studio (or the game) disable the Sunrays effect automatically.
Because if the sun is hidden, you could just instead disable/remove the sunrays effect yourself and this way it will keep this possibility for those who want this effect. I am sure if this change where to be made, it would anger a lot of people, so just compromise and simply remove the sunrays effect if you are not going to have a sun.