TweenSize in Left Corner

Hi everyone!
I want to make script for TweenSize, i made this script:

local f = script.Parent.Parent.Parent

script.Parent.MouseEnter:Connect(function()

f:TweenSizeAndPosition(UDim2.new(0.059, 0,0.119, 0), UDim2.new(0.458, 0,0.853, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)

end)

script.Parent.MouseLeave:Connect(function()

f:TweenSize(UDim2.new(0.079, 0,0.139, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)

end)

But suddenly it dosen’t work. It works, but in awful way, it’s tweensize into left up corner, but I want to TweenSize it into middle.
Video:

screen of how I have it in ScreenGui:

Shop

Thanks for every help! :stuck_out_tongue:

Change the AnchorPoint of the TextButton to 0.5, 0.5.

still dosen’t work, idk why ;/

Can you send a GIF of what it looks like now?

After you change the AnchorPoint to 0.5, 0.5, make sure the position in the tweens is always 0.5, 0.5

1 Like

Should I change the position in the script or in the Frames? I changed it in the script, but it didn’t work ;/