Tweening a SurfaceGUI

Hey there, recently I have been working on making a system that is on a SurfaceGUI, when you click Login it should tween that page off, and tween one in.
It isnt doing that and is just staying on that page, no errors.
image

script.Parent.MouseButton1Down:Connect(function()
local frame1 = script.Parent.Parent.Parent:WaitForChild(‘LoginFrame’)
frame1:TweenPosition(UDim2.new(0.5, 0,2, 0), “Out”,“Quad”, 1)
local frame = script.Parent.Parent.Parent:WaitForChild(‘MainFrame’)
frame:TweenPosition(UDim2.new(0.5, 0,0.5, 0), “Out”,“Quad”, 1)
wait(0.6)
script.Parent.Parent.Parent.LoginFrame.Login.Visible = false
script.Parent.Parent.Parent.LoginFrame.Title.Visible = false
end)

Any help?
https://gyazo.com/862adaeaf46b5399029117edd169a5b0

Works perfectly fine with a normal GUI, might I add.

Localscripts do not function in workspace. You need to set the SurfaceGui.Adornee property to the part located in workspace from the StarterGui service:

image

image

1 Like

Thank you for this! It is now working.

2 Likes