Hello, my code is working only for 1 button, and not other buttons. The code should work for all buttons. because it uses script.parent for declaring the button.
I’m trying to make the button longer in height when hover over.
I got nothing in output, so I don’t know where the problem is.
local tweens = game:GetService("TweenService")
local btn = script.Parent
local tweenInfo = TweenInfo.new(
.25,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In,
0,
false,
0
)
local tween = tweens:Create(btn, tweenInfo, {Size = UDim2.new(0, 512, 0, 286)})
local tween2 = tweens:Create(btn, tweenInfo, {Size = UDim2.new(0, 512, 0, 256)})
script.Parent.MouseEnter:Connect(function()
tween:Play()
end)
script.Parent.MouseLeave:Connect(function()
tween2:Play()
end)```
Thanks.