Constrain Niagara particles to a plane

I’m trying to have an explosion affected by a gravity force be constrained to a plane. The only thing I can think of would be to use ‘scale velocity’ and set one axis to 0 while leaving the other two at 1.

This for some reason causes the gravity force to work as if set at spawn time, not at update time. This means a slight shift downwards but the particle just shoots out in a straight line. If I switch ‘scale velocity’ to off then gravity starts working again, but my particles are of course no longer constrained.

How can I do this? There must be a simple solution?

Thanks.

P.S I’m not sure if I’ve tagged this question correctly, the tagging system on this forum is horrendous. At this point I consider myself lucky to find related tags after 5 mins.

I solved this by creating a module that does position.XYZ → position.0YZ.

I’m still curious if there’s another way, and it also seems strange that scale velocity on a single axis only kills the gravity module. My solution seems to work fine however.

hey can you take a screenshot of the module?
I presume its in the scratch pad you made a thing that does this.
thanks

In Unreal Engine five you can use the Linear Velocity mode and ad Random Range Vector to its Velocity varible. In there you should set the X and Y to -1 in minimum and 1 in maximum. Also if you set the Z value to 0 for both of them it won’t add vertical velocity to them.

Since this solution applies the velocity at the spawn of the particle. It won’t affect the gravity. You can also apply the same strategy in Unreal Engine 4.

hmm ok thanks.
im not sure i fully understand.
what i would like to achieve is to flatten the Z influence from a vector field (which cant be applied on separate axes[as far as i can see{extremely wierd}])
looks like your position.xyz → position.0yz is exactly what i would like to do…
can you post a screen shot of the scratch pad module from inside the scratch pad?
thanks. I appreaciate it alot

Depends on what you want to achieve - do you want to constrain the simulation itself to a certain plane or do you only want to render your particles (i.e. project them) to a certain plane?

If you want to simulate in a plane, then set particles.postition to lie on the plane at the end of the particle update script (which means zeroing out the x value in your example).

If you want to only render them on a plane, but simulate in all dimensions (for example to sample curl noise or skeletal mesh positions correctly), make a new attribute particles.renderPosition and set that instead at the end of your update script to the constrained position, but leave particles.position as it is. Then change the binding in the renderer to user your renderPosition attribute.