So this code is supposed to make the GUI to be slightly bigger when your mouse is over it and when your mouse isnt over it its original size, however I keep getting the Output error:
PlayerGui.MainmenuGui.PlayButton.LocalScript:4: Expected ')' (to close '(' at column 25), got ','
Ive tried to solve this but I just cant.
ALSO: I got it working once but when it grew and shrunk it because weird shapes instead os just growing. Anyway to fix this aswell?
CODE:
local object = script.Parent
object.AnchorPoint = Vector2.new(0.5, 0.5)
object.Size = UDim2.new((0.4, 0, 0.4, 0)
function OnMouseHover()
--CodeHere
print("Mouse over")
object:TweenSize(UDim2.new(0.5, 0, 0.5, 0))
end)
function OnMouseNotHover()
print("Mouse leave")
object:TweenSize(UDim2.new(0.4, 0, 0.4, 0))
end)
script.Parent.MouseEnter:connect(OnMouseHover)
script.Parent.MouseLeave:connect(OnMouseNotHover)

1 comment
This may be wrong but I'm pretty sure it'd be Udim2.new(0.4,0,0.4, 0) without the () at the end. But also you could try doing object:TweenSizeandPosition to make it exact because when you change the size of a gui, the position moves too because the middle of the gui changes when it gets bigger or smaller.