Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a certain color phase to another with Color3?

Asked by 4 years ago

I want to create a brick that phases between certain picked colors smoothly using Color3, for example;

The color of the brick starts from 89, 97, 135 then phases to 92, 100, 138 with an increasing increment with 0.1.

0
^ Fad99 286 — 4y

1 answer

Log in to vote
0
Answered by
megukoo 877 Moderation Voter
4 years ago
Edited 4 years ago

Like ForeverBrown says, using TweenService may be of use to you. Here's a sample of how it'd look in your case:

local TweenService = game:GetService("TweenService")
local part = workspace.Part -- at the starting color

local goal = { Color = Color3.fromRGB(92, 100, 138) } -- list of properties the part finishes with
local info = TweenInfo.new(3) -- you can use the wiki to edit this.

local tween = TweenService:Create(part, info, goal)
tween:Play()

Here's the article.

0
Thanks, any way to loop it to make it from the first color to the second color, then go back? DaMadnessIsBack 17 — 4y
0
Nevermind, just realised the answer. DaMadnessIsBack 17 — 4y
Ad

Answer this question