Interacting Niagara with Events

You can’t select a random number of particles that are already spawned. You can Add Velocity to them, but I believe all of them will be affected at once.

Furthermore, I believe you want the particles to be fully visible until you swipe. After that, they gradually disappear. To do that, as a rule the color (Alpha) is linked to particles age and uses the curve, and in your case it’s impossible because you never know when a swipe will happen. I tried to work with that a few days ago and I couldn’t find a way to change the curve through blueprints; idk if it’s yet possible.

Maybe you can try to link the Alpha to the velocity, but that would require constant acceleration to look good. Maybe you can create an Attraction Point with a huge radius and place it somewhere far away from the level, so that when it starts attracting particles they all will move with constant acceleration and relatively parralel to each other.

I see. So I guess, since the particles can’t “disappear” I’d have to just make these particles move out of the player screen.

Also, you’ve mentioned that I can’t select random particles after they spawn. I guess I’ll have to create two Niagara systems (ones which does not move and follows the snake head and one which the user can swipe).

However I still don’t understand how the swipe will dictate the direction of the movement of the system.

You can get the direction of your swipe, and the direction is a vector, and if you multiply this vector by a float (that represents speed), you can input the result as the new velocity for the particles.

I’ve made the blueprint for this this. I’ve multiplied the “Touch End 2D Vector” which is the last point the touch is registered,multiplied with a float and used this number to the Niagara Variable Vector3 but it doesn’t work. I’ve removed the sphere offset for the time being.

Hi Tuerer, I have another question if I may.

I have particles surrounding a static mesh but I would not like them to disappear and stick to the mesh. Even while moving around the spline. I realize that setting the burst instantaneous spawn would reset in the level after a while. What would be the correct way to achieve this?

Thanks again!

Instantaneous won’t work for that; just set a constant Spawn rate and lifetime to 0, thus they will stay where they are spawned permanently.

As for velocity, I don’t really know how touch input works. Try adding a set velocity just by typing numbers for starters, see if it works. Then you have to somehow extrapolate the screen coordinates to world coordinates…

Huge thanks, Tuerer. I don’t know how it worked but it did! For some weird reason the “2D End Vector” did not work but “2D Start Vector does”. I’ll still have to figure out more of this!

Thank you again for being so patient with me!