Help Making A Particle Emitter's Color = A Part's Color

Hi! I want to make a particle emitter’s color be the same as a part’s color. The part is going to be tweening between a variety of colors. I have been trying to figure this out but I have been very stuck. I’ve tried many scripts such as this:

Part.Color = particleEmitter.Color

any help is appreciated!! <33

EDIT: My friend helped me and I figured it out! Thank you all for the help anyways!! <33333

3 Likes

I’m not exactly sure what you mean. If you want to change the ParticleEmitter’s color to the same color of the part whenever it changes use :GetPropertyChangedSignal().

local Part = workspace.Part
local ParticleEmitter = Part.ParticleEmitter

Part:GetPropertyChangedSignal("Color"):Connect(function()
	ParticleEmitter.Color = Part.Color
end)

I think they might be asking to change already emitted particles to a parts color, but I dunno if thats possbile.

why don’t you just tween the particle emitter’s color?

I have tried to do this but it does not work. I think it is because of color sequence.

2 Likes

I just checked the API Reference, you can’t tween a color sequence

2 Likes

Lemme explain what I am trying to achieve. I have a part. This part is tweened to change colors. There is a particle emitter inside of the part that I want to be the same color as the part.

2 Likes

I’m sure you can convert the color to a color sequence like this

local function detectColorChange(part, theEmitter)
   local color = part.Color
   local sequence = ColorSequence.new(color)
   theEmitter.Color = sequence
end
game.Workspace.Part.GetPropertyChangedSignal("Color"):Connect(detectColorChange(game.Workspace.Part, ParticleEmitter))

Try it and tell me if it works

2 Likes

This would turn the part’s color to the particle emitter’s color, and even if you switch them the other way around, it would probably error

2 Likes

You can give your script to change the particleemitter’s color to the same color of the part?