kndn_v
(kanden)
May 19, 2021, 3:21am
1
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:
This is what it looks like in game:
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.
kndn_v
(kanden)
May 19, 2021, 3:31am
3
No errors, I’d already post errors if there were any.
kndn_v
(kanden)
May 19, 2021, 1:04pm
4
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)
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,
kndn_v
(kanden)
May 19, 2021, 1:35pm
6
That’s not what I’m trying to do, I’m trying to tween it while keeping its transparency as 1 the entire time.
kndn_v:
local fgoal = {Position = UDim2.new(0,0,0,0), Transparency = 0 , BackgroundTransparency = 1}
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
kndn_v
(kanden)
May 19, 2021, 1:39pm
9
Because it starts with transparency 1 and fades into view.
kndn_v
(kanden)
May 19, 2021, 1:45pm
10
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
kndn_v
(kanden)
May 19, 2021, 1:47pm
12
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)
kndn_v
(kanden)
May 19, 2021, 1:53pm
14
Not important, it’s already solved.
1 Like