Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fix this tween error where it always goes to the top left, not the set position?

Asked by 3 years ago
Edited by raid6n 3 years ago

I am quite new to scripting an i've just tried to make a tween script. It works but it never goes to the set position, it just goes to the top left of the screen. Anyone know how to fix this?

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Shop:TweenPosition(UDim2.new({{0.384, 0},{0.268, 0}}),"In","Sine",1)
end)

1 answer

Log in to vote
0
Answered by 3 years ago

Your position is written wrong. Write the Udim2 with just the numbers, not the copy and pasted property from the properties area.

Here is your fixed script.

script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Shop:TweenPosition(UDim2.new(0.384,0,0.268,0),"In","Sine",1)   
end) 

Have fun scripting!

0
Thank you ! Coder_Tom -3 — 3y
Ad

Answer this question