camera.Changed:connect(function()local A=(game.Lighting:GetSunDirection()-camera.CoordinateFrame.lookVector).magnitude local r=camera:GetPartsObscuringTarget({camera.CoordinateFrame;game.Lighting:GetSunDirection()*10000},{(camera.CoordinateFrame.p-player.Character.Head.Position).magnitude<1 and player.Character or nil})if A>1 then A=1 end for t=1,#r,1 do if r[t]then A=1 break end end;(ts:Create(blind,TweenInfo.new(.5,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0),{Brightness=(1-A)*.35})):Play();(ts:Create(blur,TweenInfo.new(.5,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0),{Size=15*(1-A)})):Play()end)
----------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Events
----------------------------------------------------------------------------------------------------------------------------------------------------------------
camera.Changed:connect(function()
	local dis = (game.Lighting:GetSunDirection() - camera.CoordinateFrame.lookVector).magnitude
	local parts = camera:GetPartsObscuringTarget(
		{ camera.CoordinateFrame, game.Lighting:GetSunDirection() * 10000 },
		{ ((camera.CoordinateFrame.p - player.Character.Head.Position).magnitude < 1 and player.Character or nil) }
	)
	if dis > 1 then
		dis = 1
	end

	for i = 1, #parts do
		if parts[i] then
			dis = 1
			break
		end
	end

	ts:Create(blind, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {
		Brightness = (1 - dis) * 0.35,
	}):Play()

	ts:Create(blur, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {
		Size = 15 * (1 - dis),
	}):Play()
end)
