Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer
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

3 comments

0

Image.ImageTransparency = 1-(i*Time/smoothness)) would also work nicely

0

Thank you so much!

0

No problem, just remember transparency 1 = 100% transparent (invisible) and transparency 0 = 0% transparent (opaque) :)

This discussion is preserved as it was. New answers, comments, and votes are closed.