Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a smooth color change?

For example, you have a part and you can change its color. But how to make the color move smoothly from one to another?

1 comment

0

TweenService.

2 answers

✓ Accepted answer
local ts = game:GetService("TweenService")

local tweenInfo = TweenInfo.new(
	10, --How long the tween takes
	Enum.EasingStyle.Linear, --Tween Style (linear is probably the best one to use in your situation)
	Enum.EasingDirection.Out, --Out is the best for your situation
	0, --How many times you want it to repeat
	false, --If it reverses after
	0 --Delay time in between
)
	
local data = {Color = Color3.fromRGB(255,0,0)} --This is the color that you want it to be
--						  The part    the tweeninfo   The data
local tween = ts:Create(script.Parent,  tweenInfo,      data)
tween:Play() --Plays the tween

This discussion is preserved as it was. New answers, comments, and votes are closed.