How do you tween textColor?

Hello, how can one tween the textColor of a textLabel from yellow to white? I have been trying to mess around with tween service and I can’t seem to get it to work. Am I doing this right?


local goal = {}
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(5)

goal.Color = BrickColor.new("White").Color

local tween = TweenService:Create(script.Parent.TextColor3, tweenInfo, goal)
tween:Play()

You’re not setting the goal correctly. You should also be tweening arguments from the TextLabel itself, not its TextColor3 property.

local goal = {TextColor3 = Color3.fromRGB(255,255,255)} -- TextColor to white.

local tween = TweenService:Create(script.Parent, tweenInfo, goal) -- tween the TextLabel, not it's property
1 Like
local goal = {TextColor3 = Color3.fromRGB(0,0,0);}
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(5)

local tween = TweenService:Create(script.Parent, tweenInfo, goal)
tween:Play()
1 Like

Oh okay! What if I wanted to include multiple text labels?

You can include multiple textlabels by doing this:

local TextLabels = {script.Parent.TextLabel1, script.Parent.TextLabel2}

local goal = {TextColor3 = Color3.fromRGB(0,0,0);}
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(5)

for i,v in pairs(TextLabels) do
    local tween = TweenService:Create(v, tweenInfo, goal)
    tween:Play()
end
3 Likes