How could i tween color?

Hi i wanted to ask why doesnt this script work?

local Folder = script.Parent.Folder
local tweenservice = game:GetService("TweenService")

local tweeninfo = TweenInfo.new(0.05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0)

local Color = Color3.fromRGB(0,0,0)

local brightness = 0


for i, v in pairs(Folder:GetChildren()) do
	task.spawn(function()
		tweenservice:Create(v, tweeninfo, {BrickColor = Color}):Play()
		
		tweenservice:Create(v.SurfaceLight, tweeninfo, {Brightness = brightness}):Play()
		
	end)
end

so it works all the way up intill the brickcolor = color, idk how to fix this can yall help?

instead of brickcolor say Color
change the variable Color to something else

local Folder = script.Parent.Folder
local tweenservice = game:GetService("TweenService")

local tweeninfo = TweenInfo.new(0.05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0)

local c= Color3.fromRGB(0,0,0)

local brightness = 0

for i, v in pairs(Folder:GetChildren()) do
	task.spawn(function()
		tweenservice:Create(v, tweeninfo, {Color= c}):Play()
		
		tweenservice:Create(v.SurfaceLight, tweeninfo, {Brightness = brightness}):Play()
		
	end)
end

:wave: Hey, here to help!

BrickColor can’t relate to Color3 (which is what you need)

If you want to change the color of a part, use Color3 for a more versatile color range or BrickColor for specific default colors.

For Color3, this change should work

To

tweenservice:Create(v, tweeninfo, {Color = Color}):Play()

hi thanks you both but now it just doesnt tween for some reason?

forget it i found the problem its fine now

1 Like