Random particle color?

Hello devs! So as the title says, I need to make particles have random RGB color (not ColorSequence), so how do I do it without script (if its not possible then with script too).

2 Likes

You’d need to use script since you’re dealing with randoms. Since RGB values range from 1-255, and bricks accept Color3 values, we will use Color3.fromRGB() to create the color. Here’s an example, place this in a script parented to a part. Test the game and it will pick a random RGB color every second.

local brick = script.Parent

while true do
	brick.Color = Color3.fromRGB(math.random(1,255), math.random(1,255), math.random(1,255))
	task.wait(1)
end

Now here’s the same logic with the emitter. ColorSequence is a must, but the code is similar. ColorSequences can be created but must have two Keyframes, so I’ll pick the random color, then create a new sequence where 0 (beginning) and 1 (end) of the sequence are the same color:

local emitter = script.Parent

while true do
	local color = Color3.fromRGB(math.random(1,255), math.random(1,255), math.random(1,255))
	
	emitter.Color = ColorSequence.new{
		ColorSequenceKeypoint.new(0, color),
		ColorSequenceKeypoint.new(1, color)
	}
	
	task.wait(1)
end
3 Likes