Random particle color that sticks?

This has literally been plaguing me since December of 2009 on UDK and seems I can’t get past it in UE4 either.

I’m trying to make a tutorial on how to make a fireworks particle system and the most important aspect of it is that the bursts be random colors. However, it is critical that the system choose a random color and then every particle be that same color.

I cannot for the life of me figure out what combination of random seeds, dynamic parameters, dynamic instances, color parameters, hueshifts, scalar parameters…etc…to achieve this. All I can do is two things.

  1. Every particle is a random color in a single burst. So it’s a big stupid rainbow of sparkles.

  2. Use a parameter collection with 65,536 entries and 65,536 separate materials and 65,536 separate emitters and 65,536 entries in a random switch. (Otherwise all the emitters are sharing the same parameter and swap mid sentence). Sure, I could pick the primary colors and just do 6 copies of all those things, but that doesn’t change the fact that this problem will have defeated me. Much in the same fashion as the waffle house defeats the purpose of the weight watchers clinic next door.

I see that there is a “Set Color Parameter” that you can drag off of a particle system…but what is that tied to? It’s not the particle color in the material. It’s not the dynamic parameter in the material either. I can’t get that thing to affect anything at all.

I can create a dynamic material instance from the spawned emitter but nothing works on that and it doesn’t make any sense anyway because which actual emitter in the system is using this? A particle system can have multiple emitters, all with different materials assigned…how can you determine which of those is what your MID is talking to? Better yet, can you even use MIDs for particle systems? I can’t figure it out.

I would of expected a Dynamic Parameter (SEED) to be the answer here but I cant’ get that thing to do anything differently than a regular Dynamic Parameter. I can tell it to only choose randomly at spawn time, but it’s done at the spawn of every particle in the emitter, so again it’s a rainbow. Not an awesome burst of green, then an awesome burst of blue and then a really uncomfortable burst of pink.

Also, what is that thingie at the top of the Dynamic SEED even doing. The one called “Parameter Name” with all the options like “Get Seed From Instance” and stuff. It doesn’t have any values associated with it. It can create an array of seeds and has a bunch of settings and stuff but none of them appear to be tied into anything at all. I get no change with any of it. It doesn’t tie into anything I can do in the level blueprint and the name I type there seems to just be arbitrarily cast out into oblivion with no reason for its existence…like nipples on a male anything.

So here’s the challenge:

A particle system that randomly chooses a color before being fired off and every single particle that gets spawned uses that same color throughout its lifetime. Multiple spawned instances of the same particle system being fired must be a different random color. Basically, the challenge is make fireworks.

I appreciate any and all help and advice you guys can give me as this has been like my nemesis for far too long now.

[UPDATE] I actually noticed now that creating a dynamic material instance on the emitter and changing the value DOES actually work…however, it only works on the first emitter in the system and does not work on subsequent emitters. Both emitters are using the same material.

Given that I’m using an event to spawn the burst up in the air where the first single particle dies, I can’t just call the burst as the first emitter in the list. That also doesn’t change the fact that both emitters are using the same material and the parameter is only affecting the first one.

[UPDATE] Ok I CAN set the burst as the first particle in the list, it WILL still be fired by the event called in the second emitter and yes…ok YES!..it works now as intended. and yes, I HATE ME! HAHAHAHA. I’m actually quite pleased.

ok, but I’d like to interject a however still, if you will allow. The fact that the parameter only affects the first emitter in a system is still broken and is what lead me to spend several hours trying everything in the rabbit hole before coming to the conclusion that this should of just worked in the first place. So I’m changing this to a [BUG REPORT] please :wink:

[FINAL UPDATE] Uh, I’m an idiot and I realized that you have to set the MID to each element of the particle system. So, there’s no bugs or anything. I’m keeping this up because I want to help other people.

Hi Hitpawz,

Good to hear you got it working properly, I will mark this question as resolved for now, but let us know if you have any further issues. Thanks!