Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to Make BackGround Fade Away?? Need Help... Still Not Working

Asked by 7 years ago
Edited 7 years ago

I am trying to make it so that GUI fades away By Decreasing The Frames Background Transparency

for i= 1, 40 do
    BGDecrease = 0.25
    Frame.BackgroundTransparency =  Frame.BackgroundTransparency - BGDecrease
wait(0.05)
end

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Assuming you've defined 'Frame', it should work; however, I will note - transparency is a value ranging from 0 to 1.

Thus, you could control it via the start and end values in your for loop, as follows:

for i = 0, 1, 0.05 do
    Frame.BackgroundTransparency = i
    wait()
end

0 is your starting point of course, which would make the frame opaque. 1 is your goal, which is completely transparent and 0.05 is your increment.

Increase the increment for a faster transition, or decrease it for a slower transition.

This would fade your frame out (opaque -> transparent, to get the opposite effect, just invert the start and end values and subtract instead.

for i = 1, 0, -0.05 do

Ad

Answer this question