So this script I have makes it to when your camera is in a part, it adds a ColorCorrection to Lighting, and changes the fog. I tried to make it to where when the camera is not in the part, the ColorCorrection and fog change to normal. But this doesn't seem to be working.
while wait(rate) do
if game.Workspace.CurrentCamera then
local campos=game.Workspace.CurrentCamera.CoordinateFrame.p
for _,v in pairs(game.Workspace:FindPartsInRegion3(Region3.new(campos,campos))) do
if v and v.Name=="Water" then
UnderWaterColor.Parent = Lighting
UnderWaterColor.TintColor = Color3.fromRGB(98, 148, 255)
Lighting.FogStart = 0
Lighting.FogEnd = 75
Lighting.FogColor = Color3.fromRGB(83, 136, 192)
end
end
end
end
while wait(rate) do
if game.Workspace.CurrentCamera then
local campos=game.Workspace.CurrentCamera.CoordinateFrame.p
for _,v in pairs(game.Workspace:FindPartsInRegion3(Region3.new(campos,campos))) do
if v and v.Name == nil then
UnderWaterColor.Parent = script
Lighting.FogStart = fogstart
Lighting.FogEnd = fogend
Lighting.FogColor = fogcolor
end
end
end
end
the rate is 0.000001, and I even tried making an invisible Air part all around the map, and I replaced "If v and v.Name =="Air" then" but that doesn't work either. I'm not sure where to go about this.
