I’m working on a game and I’ve been trying for so long to Tween a GUI when a button is clicked, but I don’t know why it won’t work. When the player clicks on a button, another GUI moves onto the screen. It won’t work for some unknown reason. The script is
local ito = game.StarterGui.MainMenu.MenuBackground.BeginGameButton
local ito2 = script.Parent.Frame
ito.MouseButton1Click:Connect(function()
ito2:TweenPosition(UDim2.new(0.105, 0,0.432, 0),"InOut","Quart")
end)
I’ve been experienced with building for many years, but I’m fairly new to coding, so I’m sorry if this is a simple script and I just can’t find the right answer.
Any help would be very appreciated. Thank you.
local ito = game:GetService("Players").LocalPlayer.PlayerGui.MainMenu.MenuBackground.BeginGameButton
local ito2 = script.Parent.Frame
ito.MouseButton1Click:Connect(function()
ito2:TweenPosition(UDim2.new(0.105, 0,0.432, 0),"InOut","Quart",)
end)
unfortunately, that doesn’t seem to be working either. i still cant figure it out. thank you for the assistance though.
edit: wait, i adjusted the script again and it fixed! the adjustments i made were
local ito2 = script.Parent --I took away the "Frame" then I moved down to the 5th line and got rid of the "," at the end.
ito.MouseButton1Click:Connect(function()
ito2:TweenPosition(UDim2.new(0.105, 0, 0.432, 0),"InOut","Quart")
end)