shampiona_na_naroda Posted January 5, 2018 Share Posted January 5, 2018 Hi everyone, so i have a question about how i can make my particles emitter to move from point to point and is it possible to do this. I have an exact example of what i need. Can someone give me a simple code example ? Thanks. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 5, 2018 Share Posted January 5, 2018 https://github.com/pixijs/pixi-particles/blob/master/src/Emitter.js#L201 That's it , just change spawn pos. There's no code example, so you have to write it yourself and then ask for help if it doesnt work. Quote Link to comment Share on other sites More sharing options...
shampiona_na_naroda Posted January 5, 2018 Author Share Posted January 5, 2018 Yes thanks this way its working but how i'm suppose to call the update method without creating new emitters everytime Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 5, 2018 Share Posted January 5, 2018 So whats the problem? Use the same emitter. > To change this, use updateSpawnPos(). Quote Link to comment Share on other sites More sharing options...
riccioverde11 Posted January 31, 2020 Share Posted January 31, 2020 Hello, I've been trying to follow what @ivan.popelyshev mentioned without any results. This is how my code looks like. const config = { speed: { start: 1, end: 5000, minimumSpeedMultiplier: 0.1 }, lifetime: { min: 1, max: 1 }, frequency: 0.008, spawnChance: 1, particlesPerWave: 1, emitterLifetime: 1, maxParticles: 1, pos: { x: 0, y: 0 }, } const emitter = new Emitter(container, [Texture.from('/particle.png')], config) let counter = 0 this.app.ticker.add(delta => { counter += 100 emitter.updateSpawnPos(10, counter) emitter.update(0.01) }) But the particle is not moving on the Y axis. What am i doing wrong? Thank you. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 31, 2020 Share Posted January 31, 2020 Hello, and Welcome to the forums! Well, its still there: https://github.com/pixijs/pixi-particles/blob/df3ca2c7aa8789f1cca266459b6746356990d261/src/Emitter.ts#L704 It should work. If it doesn't work, there's only one way to fix it - use devTools to debug the creation of the particles and why are they in the same point all the time. This is not my plugin and I have not enough experience in it to just deduce the answer from your code. Quote Link to comment Share on other sites More sharing options...
riccioverde11 Posted February 3, 2020 Share Posted February 3, 2020 Thanks for the reply @ivan.popelyshev. I think i got where the problem is. I was trying to understand how this particles effect works and basically i tried to emit only a particle at a time, if i increment the max particles, it will just work. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.