How to do a reverse particle system, with a twist

Hello all, I am browsing around in the Babylon.js forums or a Google search when I stumbled upon this interesting playground:

https://playground.babylonjs.com/#PSK6N1

It was linked from a forum post but I cannot recall the origin of this discussion, but I was what I was looking for a reverse particle system where the particles were to flow inward to a source.

Anyways, I was toying around with it, I noticed that whenever the x and/or y axis of the sphere is modified, the pyramid angle of the particle motion is changed.

For my liking, I would like to understand in how to keep the pyramid directly straight below meaning a translation. All my methods have yielded unusual angles.

I tried to use Mesh.rotation.x = Math.atan2(x,y) method, I even tried the BABYLON.Vector3.TransformNormalFromFloatsToRef() in the startPositionFunction() ParticleSystem method and even a combination of both but Iā€™m not sure what could be a possible idea for this interesting conundrum.

1 Like

It seems to me it is working: when you change the x/y position of the sphere, the pyramid still stays behind the sphere(?)

Actually, I found my own answer. It was the ParticleSystem.worldOffset Vector3 property that did the job. I found it right after posting this question.

Thanks.

1 Like