GUI transparency not working properly outside studio

I have a killfeed script for my game, and the background transparency is not setting properly. The weird thing is that it works perfectly inside studio, but not within a normal ROBLOX game. I tried printing the transparency too and it returned 1 even though it was clearly not the case.

local tsv = game:GetService("TweenService")
local feed = Instance.new("TextLabel", script.Parent)
	
feed.BackgroundTransparency = 1	
feed.Size = UDim2.new(1,0,0,25)
feed.TextSize = 10
feed.Transparency = 1
feed.Font = Enum.Font.SciFi
feed.RichText = true
feed.Text = rc(k).." "..g.." "..v.Name
feed.Position = UDim2.new(1,0,0,0)
	
local fgoal = {Position = UDim2.new(0,0,0,0), Transparency = 0 , BackgroundTransparency = 1}
local tween = tsv:Create(feed, tdata, fgoal)
tween:Play()

This is what it looks like inside studio:

image

This is what it looks like in game:

image

Both cases, as stated before, still print BackgroundTransparency as 1 even though in the second case that’s not happening.

Are you getting any errors? Make sure you press F9 or type in /console in the chat to check for errors in your game.

No errors, I’d already post errors if there were any.

After adding this bit of code after the tween code, for some reason the background transparency is back but only after the tween stops playing.

local tc
tc = tween.Completed:Connect(function()
	feed.BackgroundTransparency = 1	
	tc:Disconnect()
end)

lZNVRPjiLa

I’d like to know what even is happening, because this works perfectly fine within studio.

try doing this

-- Add this below feed.Position = UDim2.new(1,0,0,0)
repeat
feed.BackgroundTransparency = feed.BackgroundTransparency - 0.05
wait()
until feed.BackgroundTransparency = 0

Not sure if this will help,

That’s not what I’m trying to do, I’m trying to tween it while keeping its transparency as 1 the entire time.

why do you have Transparency = 0

float Transparency [hidden] [notreplicated] A mixed property of BackgroundTransparency and TextTransparency

that may be the issue
change the Transparency to TextTransparency

1 Like

Because it starts with transparency 1 and fades into view.

This worked, but the fact that it doesn’t do the same thing in studio is frustrating.

try testing the game with server mode before publishing,
i am sure that will help avoid some problems

This entirely refuses to work though.

are you getting errors or something?
also i cant find the tdata
maybe it’s somewhere else i guess:
local tdata=TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)

Not important, it’s already solved.

1 Like