Usually i'd do something like
for i = 0,1,.1 do frame.BackgroundTransparency = i wait(0.0001) end
but that makes the fade look all blocky and not right. I've seen some games make a fade even smoother than what i just mentioned. Question is how do they do it?
TweenService is always a good go-to when your trying to make something tween smoothly in and out.
Try something like this:
local TS = game:GetService("TweenService") local Frame = script.Parent local function tweenBackground() -- More about TweenInfo here: -- https://developer.roblox.com/en-us/api-reference/datatype/TweenInfo TS:Create(Frame, TweenInfo.new( 1, -- Time it takes. Enum.EasingStyle.Quad, -- Easing style. Enum.EasingDirection.Out -- Easing direction ), {BackgroundTransparency = 1}):Play() -- If you want the frame to dissapear, set BackgroundTransparency = 1. -- If you want the frame to appear, set BackgroundTransparency = 0. end tweenBackground()