Particle effect 'ceiling'

Is it possible to limit how far a particle from a particle system may exist in a certain dimension? I’m trying to create the effect of kicked up sand within water, most of which I’ve been able to do using the system… however, I’m wondering if its possible to stop the effect from travelling beyond a certain height as as it stands particles may continue travelling beyond the surface of the water - obviously an undesirable effect xD

Thanks in advance,

Fyei

There isn’t a way to do it with the particle system, but you could attach a script to it to achieve this effect very easily.

You basically have to get the particles, run through the array and set any particles above the offending height to an energy of zero. (or for a more subtle effect, reduce their energy - that way they’ll ‘age’ faster when they’re above a certain height and fade out)

You could also do other cool tricks like clamp their Y position if you don’t want them to ever physically leave the water.

Make a box which is positioned over the water. Then use a world particle collider, along with layers, so it collides only with the box.

–Eric

While that will work, sycle’s method would be much more efficient. And would be more tweakable.

Going through all particles manually every frame is certainly not more efficient that a simple box collider.

–Eric

Thanks for the ideas guys, I’ll have a crack at both and see which is the best implementation for me - having super tweak able settings may be useful for future effects if I can make the code reusable, but if it kills performance I’ll adopt the simple collider method.

Thanks!

Fyei