So I want to make a smooth transition with the Blur effect, and sure I could do something like this:
01 | local Blur = game.Lighting.Blur |
02 |
03 | script.Parent.MouseButton 1 Click:Connect( function () |
04 |
05 | Blur.Size = 1 |
06 | wait(. 1 ) |
07 | Blur.Size = 2 |
08 | wait(. 1 ) |
09 | Blur.Size = 3 |
10 | wait(. 1 ) |
11 | Blur.Size = 4 |
12 | wait(. 1 ) |
13 | Blur.Size = 5 |
14 | wait(. 1 ) |
15 |
16 | --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.
01 | local Blur = game.Lighting.Blur |
02 |
03 | function blur() |
04 | Blur.Size = Blue.Size + 1 |
05 | end |
06 |
07 | script.Parent.MouseButton 1 Click:Connect( function () |
08 | while Blur.Size < 10 then |
09 | blur() |
10 | end ) |
Untested, but should work.
~~SpiralRBX