Hey guys! Hope you are doing well.

Few minutes ago I was trying to make a smoothly text color tween, but something went wrong and now I have no idea what to do.

If you guys have some ideas, please let me know.

Here is the code:

local TweenService = game:GetService("TweenService")
local TweeningObject = script.Parent
local TweenInformation = TweenInfo.new(
	.5,
	Enum.EasingStyle.Quad,
	Enum.EasingDirection.Out,
	753475938457843579348573,
	true,
	0
)


local oldTween

script.Parent.MouseEnter:Connect(function()
	if oldTween then
		oldTween:Cancel()
	end
	oldTween = TweenService:Create(TweeningObject, TweenInformation, {Color = Color3.fromRGB(213, 115, 61)})
	oldTween:Play()
end)

script.Parent.MouseLeave:Connect(function()
	if oldTween then
		oldTween:Cancel()
	end
	oldTween = TweenService:Create(TweeningObject, TweenInformation, {Color = Color3.fromRGB(255,255,255)})
	oldTween:Play()
end)

3 comments

0

Instead of Color3,new, use Color3.fromRGB since your arguments are from 0 to 255, not 0 to 1.

0

For the amount of times to repeat you could just use math.Huge

0

I've replaced it, but it's not working anyway! In output it says: TweenService:Create no property named 'Color' for object 'TextButton'