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

I can't get the image in my GUI to fade in instead of out?

Asked by
OhNope 6
3 years ago

I have an image in my GUI and I'd like the image to fade in. My script makes it fade out and I can't understand why. I basically want it to do the opposite of what the script is doing, but every time I change it, the script breaks.

local Time = 1
local smoothness = 100

for i=1, smoothness do
    Image.ImageTransparency = Image.ImageTransparency + Time/smoothness
    wait(Time/smoothness)

1 answer

Log in to vote
0
Answered by 3 years ago
local Time = 1
local smoothness = 100

for i=1, smoothness do
    Image.ImageTransparency = Image.ImageTransparency - Time/smoothness --transparence tends to 0, thus making GUI visible. Make sure the GUI starting state has Transparency = 1
    wait(Time/smoothness)
end
0
Image.ImageTransparency = 1-(i*Time/smoothness)) would also work nicely AlexTheCreator 461 — 3y
0
Thank you so much! OhNope 6 — 3y
0
No problem, just remember transparency 1 = 100% transparent (invisible) and transparency 0 = 0% transparent (opaque) :) AlexTheCreator 461 — 3y
Ad

Answer this question