Phuein Posted September 12, 2018 Share Posted September 12, 2018 I have a particles emitter. I create a sphere and position it. Then I create the particle system. But the particles start in the original position, too. They continue in the new position, but the first ones are created and eventually fade from the starting position, too, which is unwanted. Now let's just talk code. https://www.babylonjs-playground.com/#MX2Z99#9 I added this: coreSphere.position = new BABYLON.Vector3(0, 5, -5) If you can't see the particles in the new position, turn the camera around until you do. After a few seconds the old ones dissipate. If I do preventAutoStart = true and start() the particles with a delay, like 1 second, it works as expected without particles in the original position. EDIT: I'm realizing it's because of // Pre-warm surfaceParticles.preWarmStepOffset = 10; surfaceParticles.preWarmCycles = 100; But still don't know what to do about it. The preWarm is necessary for the effect, after all. I'd expect it to warm-up in the right position. EDIT 2: Going over the engine code, I'm seeing surfaceParticles.startDelay = 1 (millisecond) solves this order issue, but still seems like a bug worth noticing? Well, it needs more delay the bigger the object, too. So random guess-solution. https://github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.baseParticleSystem.ts EDIT 3: Figured I'll try a scene-ready function, as a delay is unreliable when there's some lag. Using: scene.onReadyObservable.add(() => { surfaceParticles.start() }) Seems to work. Is this reliable? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 12, 2018 Share Posted September 12, 2018 This seems totally reliable, but it should not be necessary... I guess ? I will dig in a bit more to understand the underlying issue or even better, I will summon @Deltakosh which will take less time to fix it than me to write the answer. Phuein 1 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 12, 2018 Share Posted September 12, 2018 PR has been created here: https://github.com/BabylonJS/Babylon.js/pull/5120 bghgary 1 Quote Link to comment Share on other sites More sharing options...
Phuein Posted September 13, 2018 Author Share Posted September 13, 2018 Oh wow, you implemented a fix in the engine. Nice. Looks like it's working in the linked playground in op, so that's that. gg bghgary 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.