so, I have a script to make custom button animations, and it works… For, some of them. For some reason, these new TextButtons I have are not tweening, even though some other ImageButtons and TextButtons are tweening just fine. This is my script, located in StarterGui.
for i,button in pairs(script.Parent:GetDescendants()) do
if button:IsA("GuiButton") then
local originalSize = button.Size
button.Activated:Connect(function()
button.Size = UDim2.new((button.Size.X.Scale * 1.1), (button.Size.X.Offset), (button.Size.Y.Scale * 1.1), (button.Size.Y.Offset))
button:TweenSize(UDim2.new((originalSize.X.Scale * 1.1), (originalSize.X.Offset), (originalSize.Y.Scale * 1.1), (originalSize.Y.Offset)), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.2, true)
end)
button.MouseEnter:Connect(function()
script.Parent["ui hover"]:Play()
button:TweenSize(UDim2.new((originalSize.X.Scale * 1.1), (originalSize.X.Offset), (originalSize.Y.Scale * 1.1), (originalSize.Y.Offset)), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.2, true)
end)
button.MouseLeave:Connect(function()
button:TweenSize(UDim2.new((originalSize.X.Scale), (originalSize.X.Offset), (originalSize.Y.Scale), (originalSize.Y.Offset)), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.2, true)
end)
end
end
wait… When I tried printing the buttons name after confirming it’s a button, it, for some reason. Doesn’t go through. And I also printed when the button was hovered over, and still didn’t print. So the problem is that it doesn’t go through.