How to Alter Niagara Particle Attributes on Collision in Unreal Engine
How to change particle attributes upon collision in Unreal Engine's Niagara editor.
Did you know that Unreal Engine's Niagara editor allows you to transform your particle attributes upon collision?
In today's Quick Tip, we break down how you can use this feature set to alter your particles' color and velocity!
How to Alter Niagara Particle Attributes on Collision in Unreal Engine
- In particle update, add a "collision" module
- In collision module, set Particle Radius Scale to -1 and Restitution to -1
- Set Enable Rest State to "deactivate"
- Set CPU Trace Vector Length Multiplier to 1.0
- In particle update, add a "Do Once" module
- Set 'Trigger Condition' to "[PARTICLES] HasCollided"
- Create a New Scratch Pad Module and rename it "ChangeAttributesAtCollision"
- Add these attributes: [PARTICLES] Velocity (vector3) + [INPUT] Vector3 (rename VelMult) + [INPUT] Linear Color (rename NewColor) + [PARTICLES] Color + [PARTICLES] [DO ONCE] Execute
- Wire up these nodes: mutiply Velocity by VelMult + create 'Select' node and add a vector3 and a linear color to output + wire Execute to Selector in Select node + Multiplied Velocity into True side vector3 of Select node + NewColor into True Side linear color of Select node + '[PARTICLES] Velocity' into False side vector3 of Select node + '[PARTICLES] Color' into False side linear color of Select node
- Add these attributes to Map Set: [PARTICLES] Velocity + [PARTICLES] Color
- Wire respective outputs of Select node into inputs of Map Set node and Apply
- Set Velocity Multiplier default values to 1, 1, 1
- Set attributes to change as desired on collision
And there you go! Your particle attributes now change on collision!
Want to stay in touch with our studio as we craft world-class real-time VFX? Follow Beyond-FX on Twitter, Instagram, Facebook, YouTube, Twitch, & TikTok!