My Sky Is Ruining The Fog

Hey what’s up developers. To keep it short the sky is ruining my fog. Fog works perfectly when I don’t add the sky but when I do add the sky the fog turns off. System has different maps so it has different lighting for every map. Fog works on every other map apart from Galaxy due to the sky. Are there any settings in the sky that could be doing this? I’ll show script but it’s not a code issue since it works for everything else. (It’s on the client)

local event = ReplicatedStorage.Events.ChangeLighting
local Maps = script.Parent

event.OnClientEvent:Connect(function(mapName)
	Lighting:ClearAllChildren()
	local mapLighting = Maps:FindFirstChild(mapName)
	print("Changing lighting to: "..mapLighting.Name)
	for index, value in pairs(mapLighting:WaitForChild("LightingValues"):GetChildren()) do 
		Lighting[value.Name] = value.Value
	end
	for i, v in pairs(mapLighting:WaitForChild("AddOns"):GetChildren()) do 
		if v:IsA("Sky") then 
			local sky = v:Clone()
			v.Parent = Lighting
		else 
			local newInstance = Instance.new(v.Name, Lighting)
			for index, value in pairs(v:GetChildren()) do 
				newInstance[value.Name] = value.Value
			end
		end
	end
end)

image
when Purple Nebula gets added in it breaks the fog. Any Help?

2 Likes

I doubt this’ll help any, but I see an Atmosphere folder. Whenever you add Atmosphere to lighting, it disables the fog properties. I hope this helps!

2 Likes

That there is most likely the solution. So no fog once adding an atmosphere? Or can u add fog through the atmosphere?

Edit: Now that I think abt it, it probably won’t work since without the sky it would actually work. Ill try it out though

1 Like

You can’t have atmosphere Instance and Fog property on the lighting at the same time.
You should give up fog or give up atmosphere.
And I don’t really know how it looks with your fog, and your atmosphere, but I would recommend you to give up fog because you can also make a fog with atmosphere.

2 Likes

One of my other map works perfectly fine with an atmosphere added on with fog. This new one just doesn’t want to work with the sky it appears. But making fog with atmosphere may be solution

1 Like

I removed atmosphere and worked like a charm. Cheers and thanks @TheESPPlayerSeemoney for going more in depth with it

1 Like

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