Controlling Dynamic Niagara Material Parameter With Blueprint

Alright, Alright, Alright,

So I’ve been testing out Niagara (nothing too complex), and I’ve created a beam particle system that I’m using as a laser. I’m using the Engine material “LaserPointerMaterial” and I’m attempting to change the color of the laser inside a Blueprint.

So I created a “Dynamic Parameter” node inside the material in place of my vector 3 color node. The values for the Dynamic Parameter are 1,0,0,1; giving me a red color with a opaque alpha.

I then created a “Dynamic Mat Params” inside Niagara under “Particle Spawn.” I then created 3 User parameters which I labeled ‘R’, ‘G’, ‘B’, and plugged them in.

Then within my Blueprint I inserted a “Create Dynamic Material Instance” node as well as 3 “Set Niagara Variable (Float)” nodes, set the variable name respectively, plugged in the Laser component and the Laser Color variable.

aaaaaaannnndddd… It turns white; but nothing I change whether in the material itself, the particle system, or the blueprint changes the color, it’s just always white.

I don’t know if this is because functionality isn’t working properly or that this method only works in Cascade, but I feel like I’m doing everything right here, and it’s still not working properly. So does anyone know what I’m doing wrong/what the problem is? I wasn’t sure if the “Create Dynamic Material Instance” was even necessary, but taking it away doesn’t change anything either way.

Also I’m using the Parent material, not an instanced material. Direct source.

UPDATE: OKAY so while writing this forum post I discovered my answer! Which is wonderful! My problem: I DIDN’T FREAKING CHECK THE DYNAMIC MAT PARAMS IN THE PARTICLE SYSTEM… Big dumb. I turned it off at some point, but never turned it back on.

SO I’m going to post this anyway just in case someone else wants to know how to control color inside a material through Niagara, especially since there is such little documentation on Niagara. Also I was correct, you don’t need a “Create Dynamic Material Instance” inside blueprint, at least not for this specific action.

Hope this helps someone else in the future!

Answered my own question, but wanted to share for others! Oh also you CAN use an instance of the material!

So I found a more efficient way to do this! Pretty obvious, but use a “Particle Color” node inside the material instead of a Dynamic Parameter node. This will free up those 3 parameters for use else where. Next create a new “Color” module underneath “Particle Spawn” in Niagara particle system. (note that there is already a Color module under “Particle Update”, but the beam will remain white unless it is recreated in particle spawn.) The first time I tried this my beam went black, deleting my color module and trying again fixed this.

Next make a linear color parameter inside your “User” parameters, I named mine “User.BeamColor” and plug it into the new color module.

280060-userbeamcolor.jpg

Now in your blueprint instead of three Niagara floats, create a Niagara Linear Color variable, plug your blueprint linear color variable into it as well as the correct variable name (User.BeamColor for me) and you should now see the correct color!

1 Like

Hello, I would like to ask you a question. The dynamic parameter in the material is not used by the Dynamic Material Parameters module of the niagara system, thank you

@Jilimo You need to click on Render (which is two steps below from Dynamic Material Parameters) and over there set your Material which contains the parameter. Parameter will show up but your sprite will go off. Dont worry as you set up Float to curve (the parameter) it will come back. Also on Niagara quick start tutorial this part was missing . (There was other things missing as well. May be there was a presequel to it I dont know.

Thank you so much, it works for me!