So I want to make a smooth transition with the Blur effect, and sure I could do something like this:
local Blur = game.Lighting.Blur script.Parent.MouseButton1Click:Connect(function() Blur.Size = 1 wait(.1) Blur.Size = 2 wait(.1) Blur.Size = 3 wait(.1) Blur.Size = 4 wait(.1) Blur.Size = 5 wait(.1) --etc, etc..
But that can be a bit repetitive and messy, so I was wondering if anyone knows a way to make it do that, but with less lines of code. Thanks for the help in advance.
Hi! This is a simple one. You can use a loop to do this.
local Blur = game.Lighting.Blur function blur() Blur.Size = Blue.Size + 1 end script.Parent.MouseButton1Click:Connect(function() while Blur.Size < 10 then blur() end)
Untested, but should work.