I have a GUI that I want to tween when a button is clicked, and I'm pretty sure I wrote it correctly because I compared it to another working tween script I have.
button.MouseButton1Up:Connect(function()
if not selected then
InventoryFrame:TweenPosition(
UDim2.new(0.499, 0, 0.063, 0)
"Out",
"Quad",
1,
true
)
selected = true
else
InventoryFrame:TweenPosition(
UDim2.new(1.2, 0, 0.063, 0),
"Out",
"Quad",
1,
true
)
selected = false
end
end)
When I click the button I get an output saying Players.frogeater12345.PlayerGui.Hotbar.Hotbar.Inventory5.InventoryButtonScript:9: attempt to call a UDim2 value

2 comments
You forgot a , on line 4. UDim2.new(0.499, 0, 0.063, 0) needs to be UDim2.new(0.499, 0, 0.063, 0),
Thanks WizyTheNinja I didn't see that