Transparency Does not Work

Hey, So I am making a loading screen, I have the bar and music working but after a certain amount of time, I set it so the background transparency fades out, I put this script together but I does not work, Can anyone help?

local mainframe = script.Parent

local function diss()

while wait(.1) do
	mainframe.BackgroundTransparency = mainframe.BackgroundTransparency -0.1
  end
end

wait(26)

diss(mainframe)

I recommend using TweenService for this.

I just don’t understand tween service, even though I have read that article about 20 times.

Perhaps this video can be of some help?

Let me know if this works for you:

local TweenService = game:GetService("TweenService")

local tween = TweenService:Create(mainframe, TweenInfo.new(2), {BackgroundTransparency = 0})

tween:Play()

unfortunately, unless its because I modified:

local TweenService = game:GetService(“TweenService”)

local mainframe = script.Parent

wait(25)

local tween = TweenService:Create(mainframe, TweenInfo.new(2), {BackgroundTransparency = 0})

tween:Play()

Maybe try BackgroundTransparency = 1 instead of 0.

1 Like