Liquid fun particles from changing position/rotation

Hi. I’m trying to create a sort of particle stream which fires from a cannon of sorts. I can manually set the x/y & velocityX/velocityY of the particles which works when it’s static but the cannon can be moved by dragging it and the particles need to follow as if coming from the barrel.

Crappy sketch to illustrate:

EEUKAhr.png

I’ve tried searching for similar issues but can’t seem to find anything so any pointers would be much appreciated!

Hi @neilh,

Without seeing your code, I would assume/suggest that you should calculate the angle of the cannon (using math/trig) as the angle changes, and then adjust the velocityX and velocityY of generated liquid particles accordingly.

Take care,

Brent

Thanks Brent, managed to get it working pretty well just before the question got approved with ‘localToContent’ to get the x/y coords of the cannon end. The direction of particles is ok but could be improved so I’ll see if I can work out the angles from here…

Hi @neilh,

Without seeing your code, I would assume/suggest that you should calculate the angle of the cannon (using math/trig) as the angle changes, and then adjust the velocityX and velocityY of generated liquid particles accordingly.

Take care,

Brent

Thanks Brent, managed to get it working pretty well just before the question got approved with ‘localToContent’ to get the x/y coords of the cannon end. The direction of particles is ok but could be improved so I’ll see if I can work out the angles from here…