How do i tween brick color?

How do i tween brick color? line i’ve tried:

local tg0 = {Color = BrickColor.new("Really red")}

doesn’t work. I have done tweens before. i know how tweenservice works.
my code is fine, but trying to tween brick colors does’t work.
"TweenService:Create property named ‘Color’ cannot be tweened due to type mismatch (property is a ‘Color3’, but given type is ‘int’) "
i tried replacing Color with BrickColor.

1 Like

You should be tweening a Color3 property, not a BrickColor property. The BrickColor property cannot be tweened.

1 Like

that sucks. really. it’s hard to use color3 for exact colors.

Here’s an example of how I’d tween a brick color from red to blue:

*edit: small correction, it should be fromRGB not FromRGB

local tweenService = game:GetService("TweenService")
local part = workspace.Part

--information
local tweenInfo = TweenInfo.new(
    2,
    Enum.EasingStyle.Linear,
    Enum.EasingDirection.In,
    0,
    false
)

--part is red
part.Color = Color3.fromRGB(255,0,0)

--tween the part to blue
local tween = tweenService:Create(part, tweenInfo, {Color = Color3.fromRGB(0, 0, 255) })
tween:Play()
1 Like

You can get a Color3 value from a BrickColor if you use .Color
Example:

BrickColor.new("Really red").Color
2 Likes

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