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

How do I make my ui fade to appear (1-0)?

The transparency needs to go from 1-0

local frame = script.parent


I know it has something to do with

For i in i

1 answer

You can use TweenService to tween the transparency property smoothly into 0. TweenService can also tween other properties such as Color3

local frame = script.Parent

local tweenService = game:GetService('TweenService')

local timeout = 1 -- will tween within 1 second

function fade(transparency)
	tweenService:Create(frame, TweenInfo.new(timeout), { Transparency = transparency }):Play()
end

fade(0)

If you want to fade it to 0 with for loop you can do this

local frame = script.Parent

function fade()
	for i = 1, 0, -0.1 do
		frame.Transparency = i
		wait(0.1)
	end
end

spawn(fade)

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