So this script is supposed to make the GUI grow to half its size when you put your mouse over it, and when your mouse isn't over it, it shrinks back to its original size.

However,

A: the script isn't working for some reason|

B: when it did work, the size got all messed up

Is there a way to fix these both?

CODE:

local object = script.Parent
object.AnchorPoint = Vector2.new(0.5, 0.5)
object.Position = UDim2.new(0, -object.Size.X.Offset, 0.5, 0)
 





function OnMouseHover()
--CodeHere
object:TweenPosition(UDim2.new(0.5, 0, 0.5, 0))
end
script.Parent.MouseEnter:connect(OnMouseHover)

function OnMouseNotHover()
--CodeHere

object:TweenPosition(UDim2.new(0.4, 0, 0.4, 0))
script.Parent.MouseLeave:connect(OnMouseNotHover)

2 comments

0

Correct me if im wrong, but isn't tween service for moving gui's?

0

No. TweenService tweens all number-based properties. And booleans.