Blur fading away

So I am making a loading screen and it has a blur effect. I am just wondering, how would I make the blur, “Fade away”? Heres some more info:
I want it so slowly fade then when it is completely gone it deletes the blur effect. Would I make this in a while true do loop?

2 Likes

Here should be a fine way of ‘fading away’ the blur effect.

while BlurEffect.Size > 0 do
    BlurEffect.Size = BlurEffect.Size - 0.01
    wait(0.01)
end

Did not work, here is my script (Your script is in the MouseButton1Down function)

game.ReplicatedFirst:RemoveDefaultLoadingScreen()
local BlurEffect = game.Lighting.Blur
script.Parent.Parent.Play.Visible = false
local FirstNumber = 0
local SecondNumber = 10
local final = "Loading Extra Assets: "..tostring(FirstNumber).."/"..tostring(SecondNumber)

local object = script.Parent

object.Position = UDim2.new(0,0,0,0)
 
wait(1.5)

while true do
	wait(math.random(0.5,3))
    FirstNumber = FirstNumber +1
    local final = "Loading Extra Assets: "..tostring(FirstNumber).."/"..tostring(SecondNumber)
    script.Parent.Main.Text = final
	if FirstNumber >= SecondNumber then
		object:TweenPosition(UDim2.new(1,0,0,0), Enum.EasingDirection.In)
	wait(0.1)
		script.Parent.Parent.Play.Visible = true
		script.Parent.Main.Text = "Loading Is Done!"
	

        break
    end
    
end


script.Parent.Parent.Play.MouseButton1Down:Connect(function()
	object:TweenPosition(UDim2.new(1,0,0,0), Enum.EasingDirection.In)
	while BlurEffect.Size > 0 do
		BlurEffect.Size = BlurEffect.Size - 0.01
		wait(0.01)
	end
	script.Parent.Parent.Play:Destroy()
end)

Do this

for i = 1,Size of it then
Game.Lighting.Blur.Size = Game.Lighting.Blur.Size -1
wait(.01)
end

^Should work

Why didn’t her/his script work? It should have.

The comment above is my comment lol but it does not work…

I am a boy and you probably did miss something
Size of it = the blur’s properties - size
And you should add wait >-> (Just found out the bug

I was referring to @Chaddaking but ok,

@AzimuthBecameReal what do I put in the ‘size of it’?

didnt work, why did it not work?

i would use a repeat wait loop

Change ‘blur’ to whatever variable you assigned the blur in lighting to

repeat wait()
blur.Size = blur.Size - 0.05
until blur.Size <= 0
1 Like

You can tween the blur size. Example:

local tweenService = game:GetService("TweenService");

local blur = Instance.new("BlurEffect");

blur.Parent = workspace.CurrentCamera

local tweenInfo = TweenInfo.new(
	4
)

local goal = {
	Size = 0
}

local tween = tweenService:Create(blur, tweenInfo, goal)

tween:Play()
2 Likes

You should definitely use TweenService for this!

1 Like