Alrighty, so I am making some sort of form but I want a smooth fade away every time someone presses the button, but I am having some troubles tweening the transparency of a backround frame. Is there a way to tween the visibility?
My code: (no errors)
local PlayerGUI = game.Players.LocalPlayer.PlayerGui
local button = PlayerGUI.ScreenGui.StartPage.Start
local SP = PlayerGUI.ScreenGui.StartPage
button.MouseButton1Click:Connect(function()
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local TweenService = game:GetService("TweenService")
TweenService:Create(SP, tweenInfo, {BackgroundTransparency = 1})
end)
hey im tweening some gui as well, but this is how i have it set up
local clickPart = game.Workspace.Storage.Lobby.Shop:WaitForChild("ShopClickPart")
local click = clickPart.ClickDetector
local actualShpGui = script.Parent.ShpFrame
local exitBttn = actualShpGui.Exit
exitBttn.MouseButton1Click:Connect(function()
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
1, -- number of seconds to complete
Enum.EasingStyle.Cubic, -- how it moves
Enum.EasingDirection.InOut, -- how it moves too
0, -- how may times it repeats
false, -- reverse too aka go back to start
0 -- seconds before starting
)
local properties = {
--["CFrame"] = killBrick.CFrame + Vector3.new(-8.5, 0, 20)
["Position"] = UDim2.new(.5,0,1.3,0)
["BackgroundTransparency"] == actualShpGui.BackgroundTransparency + 1
}
local tween = TweenService:Create(actualShpGui, tweenInfo, properties)
if debounce == true then
debounce = false
tween:Play()
end
if tween.Completed:Wait() then
actualShpGui.Visible = not actualShpGui.Visible
end
debounce = false
end)