I’ve tweened many GUI objects in the past but for some reason it doesn’t seem to work. I didn’t add a parameter for the player because its a LocalScript.
I see many problems with the code you provided. Firstly, you shouldn’t be using game.Workspace at all, because the workspace doesn’t contain the StarterGUI.
What you should do is reference each GuiObject from the script:
you forgot the parameters even though they’re set by default, you should have them
local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local ScreenGui = PlayerGui:WaitForChild("ScreenGui")
local Frame = ScreenGui:WaitForChild("Frame")
local TextButton = PlayerGui.hmm.TextButton
TextButton.MouseButton1Click:Connect(function()
Frame:TweenPosition(UDim2.new(0.475, 0, 0.411, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1)
end)
I might’ve written something wrong, if so then correct me, but once player enters the game, everything from StarterGui goes to PlayerGui, also make sure there isn’t another ScreenGui in the PlayerGui as that could cause an error or it might tween the wrong Frame
I still might be wrong though
Sheesh, thanks for that! I didn’t even realise that I used workspace, I already know that the StarterGUI isn’t in the workspace but I always include it. I wish Roblox set a layout on the explorer which can push workspace to the right and the others to the left so that future devs will understand what is not in workspace and what is in workspace. Anyway, its basic, sorry for that!