Make particles position not relative to its parent


#1

Hi,

How do you make particles position not relative to its parent? Currently if I move the parent (on the s2d) of a Particles all the particles move at once.

particleEmitter = new Sprite(s2d);
particleEmitter.x = 10;
particleEmitter.y = s2d.height / 2;
var particles = new Particles(particleEmitter);
var particleGroup = new ParticleGroup(particles);
particles.addGroup(particleGroup);

So basically I’d like the particles to be emitted from the parent but not move with it.


#2

sadly I don’t think that’s possible right now, I’m accepting a patch for it :slight_smile:


#3

Maybe I’m using it the wrong way, how would you have an object leave a trail of particles behind it when it moves ?


#4

By first look there is no way to implement what you want, due to how rendering is implemented for s2d and 2D particles specifically. But I’ve made support for non-relative particles in somewhat usable form, you can take a look at PR here: https://github.com/HeapsIO/heaps/pull/441


#5

Thanks I’ll take a look at it and test it.