im trying to make all guis tween away when the player clicks play but when I tried to use Udim2 the output said its “Unable to cast value to function” this is my code:
script.Parent.MouseButton1Click:Connect(function()
hrp.Anchored = false
settingsbutton:TweenPosition(UDim2.new(-1, 0, 0.644, 0), "InOut", "Sine", 0.5, true, false)
task.wait(0.2)
creditsbutton:TweenPosition(UDim2.new(2, 0, 0.644, 0), "InOut", "Sine", 0.5, true, false)
task.wait(0.2)
title:TweenPosition(UDim2.new(0.188, 0, -2, 0), "InOut", "Sine", 0.5, true, false)
task.wait(0.2)
playbutton:TweenPosition(UDim2.new(0.398, 0, -1, 0),"InOut", "Sine", 0.5, true, false)
task.wait(0.2)
Background:TweenPosition(UDim2.new(0, 0, 1, 0),"InOut", "Sine", 0.5, true, false)
settingsbutton.Visible = false
settingsbutton.Active = false
creditsbutton.Visible = false
creditsbutton.Active = false
title.Visible = false
title.Active = false
playbutton.Visible = false
playbutton.Active = false
Background.Visible = false
Background.Active = false
end)