I wanted to make a effect where if the camera is inside the “Waterpart” the color will change, but the color is changing too much
Inside the water:
Outside the water
Here’s my code :
task.spawn(function()
Camera.Changed:Connect(function()
task.wait()
if Camera.CFrame.Position.Y > -11 and not IsUnderWater then return end
if not IsUnderWater and Camera.CFrame.Position.Y < -11 then
IsUnderWater = true
print("Is Underwater")
Lighting.ColorCorrection.TintColor = Color3.new(0,0,255)
local Blur = Instance.new("BlurEffect")
Blur.Size = 8
Blur.Parent = Lighting
elseif IsUnderWater and Camera.CFrame.Position.Y > -11 then
IsUnderWater = false
print("Camera Exited")
Lighting.ColorCorrection.TintColor = Color3.new(255,255,255)
Lighting.Blur:Destroy()
end
end)
end)