Udim2 Scale With Math

Hello devs,

I’ve been thinking for a good hour now how to use in the Udim2 function for example that the size is only increased by a certain number ( aka using math )


I’ve tried this, for example

btn.MouseEnter:Connect(function()

	isHovering = true

	btn:TweenSize(UDim2.new(btn.Size + 1), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)

If there is a solution to this, what and where can I find it?

Thank you!

Cursed.

local SizeEnhancement = UDim2.fromOffset(10,10)
btn.MouseEnter:Connect(function()

	isHovering = true

	btn:TweenSize(btn.Size + SizeEnhancement, Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)

Also use tween service. :TweenSize is deprecated.

Thank you, working perfectly.

I seriously would never have thought of this one.

You’ll get better with time.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.