Tether particles to System origin in Ue4 Niagara

Hi, I’m wondering if anyone can help me figure out how to do something with Particles in Niagara in Unreal Engine 4?

What I’d like to do is find a way to tether particles to the origin of the system, so that they cant move past a certain radius, almost like they have a string tying them to that spot. I want to still be able to apply forces to them, so messing with velocity, gravity, etc. but if they get towards the end of the radius be able to stop them drifting out of it.

Using the above image as an example, if Particle (P1) has gravity suddenly enabled I would want it to follow the green path so it maintains a max distance from system origin, rather then falling straight down the grey path like it normally would. Or if I give P1 velocity to the upper right it would move up to the edge of the radius and then maintain its position and not fly off into the distance.

If anyone has any ideas on how this would be done please let me know, and if im being stupid and dont know about a really obvious way to do this definitly let me know and be kind

Thanks

Hi. I would go about this by writing a custom script to determine the position and rotation of particles based on the emitter’s simulation position. You could use this to determine how far out they should go from the emitter’s simulation position. Possibly a vector4 with the 4th part used for rotation.

There are most likely simpler or better ways to do this but this is how I would begin, then build upon it.

I think you can achieve this by checking the rotate-around point module and then blending the rotational velocity with your current particle velocity based on whatever mask or region you determine that when gravity is enabled.

What you could try to do is use a “vector rejection” of the velocity vector against the sphere’s normal. That way you could keep the velocity that is perpendicular to the sphere’s normal, but remove the velocity that is along the normal.
If you don’t know about vector projection and vector rejection, they are useful vector math concepts to know. Vector projection - Wikipedia

Here is how I would do that in a Niagara scratch module.