Niagara Random Color

So I am trying to create a fire work effect. I have 4 modules: 1 missile that spawn a trail as it moves and a explosion that trigger when the missile dies. The explosion leave a trail behind.

I want to be able to give the missile a random color and to pass down that random color to all my other modules. My question is how can a get the random value from my first module and feed it to all my other color.


1 Like

Hey there @CycKlone! Welcome back to the forums!

So generally if we want to propagate changes to the system we’ve got two options. You can either set the color parameter via blueprints and bind that parameter to each of your systems, or if you’re really fancy you could work with creating a module that does it, however I’m not a fancy person so I’ll give you a quick run down of how I’d do this via BP.

So in your Niagara system, make a new parameter for Linear Color. I just named mine Linear color because I’m not very creative.
image

Then bind it to whatever color you want to be synced and do this for every single emitter you need.
2022-09-09_20-23-52

then head on over to whatever actor BP can make a reference to your Niagara system, might be it who spawns it and can get a reference due to being a firework. Then you’ll make something a little like this where you either build a new color from code (where you can randomize it) or put in another color however you want.

and voila!

UnrealEditor_2022-09-09_20-30-02

Hope this helps!

4 Likes

Hey thank you for the response,
I understand your solution and it worked, but I think I want to be fancy and make it all in my niagara system, so I think I will try to build my own module!

If you have any input on that let me know.

Absolutely! I don’t use the scratch pad often myself, as I don’t do too much on the art side in any team I work on, but I can get you a tutorial and some documentation (unfortunately there’s no solid doc for the scratch pad). From the bit I played with it, it’s pretty useful and you can make custom modules that can do a ton without needing BPs to do so. That said, it’s a bit more complicated, so expect to have to play around with it!

Disclaimer: Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

Getting started:

Hope this helps!