Problem tweening gui

I’m trying to tween this gui position for an intro, but its not tweening when I click the button. Here is the script.

local gui = script.Parent.Parent

local button = script.Parent

local tweenservice = game:GetService("TweenService")

button.MouseButton1Click:Connect(function()

gui:TweenPosition(UDim2.new({0, 0},{1, 0}), Enum.EasingDirection.In, Enum.EasingStyle.Back)

gui.Visible = false

end)

Here is the explorer.

image

Super close.

When you create UDims, you don’t actually pass in tables as arguments for that. Instead, you pass in 4 numbers to act as the scale and offset values. I know, it’s a bit misleading how it’s formatted on the Properties window.

Try this instead:

gui:TweenPosition(UDim2.new(0, 0, 1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Back, 2)

1 Like

Ahhh, thank you. I didn’t know that and just copy pasted the position box :joy: thank you!

1 Like