How do u make a fade out/in gui?

im tired of making fade out/in stuff by doing script.parent.transparency = 0.1 task.wait(0.01) etc, how do u make it without doing all that extra stuff?

You would use TweenService!

TweenService allows you to smoothly adjust some properties.

e.g.

local TweenService = game:GetService("TweenService")
local Frame = script.Parent

local Tween = TweenService:Create(Frame, TweenInfo.new(1), {Transparency = 1}:Play()
Tween:Play()
-- Fades out the frame over 1 second
1 Like

THANK YOU SO MUCH!!!

local Tween = TweenService:Create(Frame, TweenInfo.new(1), {Transparency = 1}:Play()
Tween:Play()
-- Fades out the frame over 1 second

at the :Play part it shows a red underline

why is there another :Play() on variable when they’re already playing??

alsso there’s no “)” at the end, you’re instead trying to play it when there’s already one.

local Tween = TweenService:Create(Frame, TweenInfo.new(1), {Transparency = 1})
Tween:Play()
-- Fades out the frame over 1 second
1 Like
thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.