Very confused why this strange effect occurs with my button script:
-- Variables --
local soundHover = game:GetService("SoundService"):WaitForChild("SoundEffects"):WaitForChild("Clicks"):WaitForChild("UI Hover")
local soundClick = game:GetService("SoundService"):WaitForChild("SoundEffects"):WaitForChild("Clicks"):WaitForChild("ButtonClick")
local btn = script.Parent
local isHovering = false
-- Functions --
-- ClickFeedback --
btn.MouseButton1Down:Connect(function()
btn:TweenSize(UDim2.new(0, 154,0, 49), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)
btn.MouseButton1Up:Connect(function()
if not isHovering then
btn:TweenSize(UDim2.new(0, 164,0, 54), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
else
btn:TweenSize(UDim2.new(0, 174, 59, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end
end)
-- HoverFeedback --
btn.MouseEnter:Connect(function()
isHovering = true
soundHover:Play()
btn:TweenSize(UDim2.new(0, 174,59, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)
btn.MouseLeave:Connect(function()
isHovering = false
soundHover:Play()
btn:TweenSize(UDim2.new(0, 164,0, 54), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)
video link here.