Backgroundtransparency tween not working


local tweenServ = game:GetService("TweenService")

game.Players.LocalPlayer.Character.Humanoid.Died:Connect(function()
	
	local ui = game.Players.LocalPlayer.PlayerGui.blackScreenOnDeath
	
	ui.Enabled = true
	wait(3)
	local uiTween = tweenServ:Create(ui.Frame, TweenInfo.new(3), {BackgroundTransparency = 1})
	uiTween:Play()
	uiTween.Completed:Wait()
	ui.Enabled = false
	ui.BackgroundTransparency = 0 --reset back to visible
	
end)

I want a black screen to appear when I die and fade away shortly after I respawn.
I’m trying to tween the background transparency from 0 to 1.
When I die, the black screen appears, but no tweening happens, and the black screen never disappears. What did I do wrong?

1 Like

try adding an EasingStyle

TweenInfo.new(3,Enum.EasingStyle.Linear)

didnt work

cccccchhhhhaaaaarrrrraaaccter limit

TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.In)

im fairly certain that just adding more stuff to the tweeninfo isnt gonna work, considering leaving it blank just assigns it roblox’s default but i guess ill try anyways

yeah nothing

no they use background transparency

the issue was because i had the script in startercharacterscripts meaning it resets the script when your player dies, meaning the script stopped before the tween could begin
just adjusted it a little and moved it to startergui and were good

you should check if your frame is not in BackgroundTransparency = 1 because if this is the case it is normal that it does not tween