- Home /
How do I set the color of a particle? Do I need LateUpdate?
I have balloons as my particle. I don't want random colors, but also not the same color. I want the balloon color to be 1 of 6 presets, red green, blue, etc.
I have seen this: http://answers.unity3d.com/questions/222352/random-amongst-3-colors-in-particle-system.html and http://docs.unity3d.com/ScriptReference/ParticleSystem.GetParticles.html
And all I can find is to call GetParticles, run through the array, and then SetParticles. But the weird thing is that even in the example, they are operating on every particle on every frame.
Do I need to set the color of every balloon on every frame? is there a better way to do this? I tried doing it in the Start() function but the particles have not spawned yet. I assume the particles are pooled so hopefully there is a way to do this?
Another option is to make 6 emitters, one for each color.
If you only need 1 of 6 colors then having an emitter per color is not such a bad idea. You could prefab a single emitter and create 6 at runtime and just assign a different color to the startColor property.
Alternatively you could just cycle the startColor property with a script.
Your answer
![](https://koobas.hobune.stream/wayback/20220611232105im_/https://answers.unity.com/themes/thub/images/avi.jpg)