Rainbow color change isnt working for multiple parts

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Rainbow color change for all parts in a model
  2. What is the issue? Include screenshots / videos if possible!
    When I test the color doesn’t change
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried making brick just be one singular part and it worked so i think the issue is the get children but idk
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local Brick = script.Parent.RP:GetChildren()
local speed = 0.25
while true do
	for i = 0,1,0.001*speed do
		Brick.Color = Color3.fromHSV(i,1,1) 
		wait()
	end
end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like
local bricks = script.Parent.RP

function colorBrick(i)
    for _, brick in pairs(bricks:GetChildren()) do
        brick.Color = Color3.fromHSV(i,1,1) 
    end
end

local speed = 0.25

while true do
	for i = 0,1,0.001*speed do
        colorBrick(i)
        wait()
    end
end

You need to loop through each brick in the model to change its color

1 Like

the i in the .fromHSV(i,1,1) is saying its undefined

Ahh sorry about that, I just made an edit to the script, try it now!

1 Like