https://playground.babylonjs.com/#IPJDQG#1
Just noticed this, is this the intended behavior? When cloning a particle system that hasn’t yet started, the clone seems to auto-start.
https://playground.babylonjs.com/#IPJDQG#1
Just noticed this, is this the intended behavior? When cloning a particle system that hasn’t yet started, the clone seems to auto-start.
Let me take a look …
It does start, no matter if you ‘force stop’ the main before hand. Not sure this would not require a small fix. It seems odd to act this way, even if the go-around is easy.
Looking at ParticleSystme source code Line 2133 I can see that cloning is done with
var result = ParticleSystem.Parse(serialization, this._scene || this._engine, this._rootUrl);
now… Parse()
method is the one that takes an optional parameter doNotStart?: boolean
as described in documentation for ParticleSystem.Parse()
.
@Cedric It seems param is optional and currently I can’t find a way to pass that from clone()
level.
@blindinghues I would suggest you manually stop it after cloning until it is corrected
By default, cloned particles system start.
But you can prevent that by setting :
particleSystem.preventAutoStart = true;
Then, cloned particle system won’t start.
Fixed PG:
clone issue | Babylon.js Playground
@MarkBevels , I think you got it.
Just tried this:
var particleSystemCloned = particleSystem.clone(“particles2”, 1);
‘https://playground.babylonjs.com/#IPJDQG#3’
and it does work, I believe…
Edit: you do not need to force stop the initial particle system. It is a remain of my old attempt
It is you who gave us the solution (and took the time to look back at the code, so…) Thank You!
No worries @mawa. I started using babylonJS for my sci-fi game and already got amazing amount of help from you guys so trying to make myself useful where I can. Spending my coffee breaks on the forum to rest from my code and learn.
@Cedric , lol, thanks for that.
that’s even better. Now, we even have a choice Isn’t life just beautiful with BJS
That’s an excellent mindset @MarkBevels ! So happy to have you part of the community
Yes it is!
Happy to be here @Cedric . You guys do the hard work, we just rip the benefits.
we sure do
Wow what a flurry of activity, thanks everyone! This is indeed an amazing community