The UI doesn’t change their sizes when the mouse goes in and out any ideas?
local TweenService = game:GetService("TweenService")
local sound = script.Sound
local sound2 = script.Sound2
local ui = script.Parent
local originalSize = ui.Size
local enlargedSize = UDim2.new(originalSize.X.Scale * 1.1, originalSize.X.Offset, originalSize.Y.Scale * 1.1, originalSize.Y.Offset)
local function resizeButton(button, targetSize)
local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local tween = TweenService:Create(button, tweenInfo, {Size = targetSize})
tween:Play()
end
local function shrinkButton(button)
resizeButton(button, originalSize)
end
ui.MouseEnter:Connect(function()
resizeButton(ui, enlargedSize)
sound:Play()
end)
ui.MouseLeave:Connect(function()
shrinkButton(ui)
end)
ui.MouseButton1Click:Connect(function()
sound2:Play()
end)
Are you receiving any errors in the output?
Try adding print statements under both MouseEnter and MouseLeave functions to determine if those functions even run.
your script works, it just has a calculation problem I think, you should scale the button in edit mode, copy the size, and paste it in the variable enlargedSize and it would be easy.
Although TweenSize (and its related functions) are simpler to use, TweenService is more complex and has much more use for a variety of things. But it generally shouldn’t matter which method you use. None of which should have a problem (unless you use it the wrong way). I’d personally recommend using TweenService if you nearly have a full understanding of it.