Im working on trying out how to tween a gui into appearing however I have little to none experience in it so can anyone tell me why this isnt working?
Nothing prints
local TweenService = game:GetService("TweenService")
local Fade = game.StarterGui.Fade
game.StarterGui.ScreenGui.TextButton.MouseButton1Click:Connect(function(Clicked)
print("Clicked")
local goal = {}
Fade.Visible = true
Fade.BackgroundTransparency = 0
local tweenInfo = TweenInfo.new(5)
local tween = TweenService:Create(Fade, tweenInfo, goal)
tween:Play()
end)
Yeah, it does not work because you have not put anything inside of the goal table.
I assume you want to change the BackgroundTransparency to 1, then do:
You’re never assigning a target, like the person above me said.
Try something like:
print("Clicked")
local goal = {BackgroundTramsparency = 1}
Fade.Visible = true
Fade.BackgroundTransparency = 0
local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local tween = TweenService:Create(Fade, tweenInfo, goal)
tween:Play()
also, referring to StarterGui means that this function will never be run anyway. If this is on the client, use a LocalScript within the element. You must refer to PlayerGui on the server, but it’s not recommended to handle GUI on the server anyway.