Changing Particle System Extents Behaves Strangely

I am trying to adjust the emitter extents of some particle systems during run time. I have one system getting smaller and one getting larger. They are both controlled by pulling values from two different curves (one for each particle system).

The system that gets smaller, works how I would expect. The system that gets larger initially seems to be working, but always stops growing at what looks like about half the expected size. I can output the emitterExtents sizes to the console, and they are all registering correctly. If I head over to the editor and tweak any of the particle system properties that don’t reset the system, then the system starts to appear correctly.

I have tried using the reset command at various times, and this doesn’t fix the issue.

I can’t point to a project at the moment, but could probably create a sample if needed.

Anyone have similar experience or ideas?

1 Like

Hi @Travis and welcome!

The only thing that comes to mind is the particles lifetime not being long enough for the large emitter, but I think you’ve already checked this if it’s working from the editor.

If you can post a sample it would be great, especially if it’s a bug to register this on the engine repo.

Thank you for the quick response. I worked up a quick example here. The “floor” and “ceiling” demonstrate the max extents of both particle systems.

If you press the START button, it will start to shrink the red system, reaching zero at 5 seconds. At this point, the blue system starts to enlarge and achieves the same 5x5x5 dimensions that the red one started at. You can see the blue doesn’t accept its emitter extents values.

If you run this from the editor and toggle an option on or off in the blue system, it will start behaving correctly.

Let me know if there is a better way to provide an example.

Thanks!

Good, I understand your issue. Since it’s working when you update the properties in the editor, I imagine it’s something with how you are setting them in code.

Normally the particles system component will take care of rebuilding the particles graph, but if that doesn’t happen you can get similar behavior.

Try forcing that manually when you start animating the blue emitter, using either of these methods:

this.entity.particlesystem.rebuild();
this.entity.particlesystem.reset();

Thanks for the quick response, again!

I guess it’s just inherit in how particles in general work, but when I use the rebuild or reset command, the particles flash–I assume while the shader is rebuilt and everything is rendered anew.

I was hoping I could get my tactic to work since it seems to do well for a shrinking system. Maybe I need to think of a different method for the enlarging portion of this process.

Oh, it doesn’t seem like the rebuild command is covered in the API documentation as far as I could see:
https://developer.playcanvas.com/en/api/pc.ParticleSystemComponent.html

Yes, it’s an internal method that the component uses to update the system properties, normally you should be using it directly.

I think what you request makes sense, would you like to submit an issue about it in the engine repo? Most likely an update can be pushed to fixed your issue.

OK, I submitted the issue here: https://github.com/playcanvas/engine/issues/1914

I am happy to add details or info if there isn’t enough there.

1 Like

This has been updated. I haven’t tried it out yet, but really appreciate the quick reaction from the team!

1 Like

@Leonidas

I have a general question. When are changes to the master branch built into the pre-built versions of the engines at the provided URLs? Obviously, I can build my own, but just trying to get a good workflow going here. I wasn’t clear if this was demarcated somewhere in the repo… I couldn’t find anything.

Yes, whenever there is a change to the master branch a new development build is made available, in the url found in the README:

The stable releases are more sporadic and you can follow their announcements here: