Help with Tweening TextColor on MouseEnter and MouseLeave

I have a button, and I want it to change color when the mouse hovers over it. When the mouse leaves the selection area, it switches back to its original color. From 0, 170, 0 to 0, 0, 0,, and vice versa.

local Button = script.Parent

Button.MouseEnter:Connect(function()
	game:GetService("TweenService"):Create(Button, TweenInfo.new(0.4, Enum.EasingStyle.Quad), {TextColor = Color3.fromRGB(0, 0, 0)}):Play()
end)

Button.MouseLeave:Connect(function()
	game:GetService("TweenService"):Create(Button, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {TextColor = Color3.fromRGB(0, 170, 0)}):Play()
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.