Bug / Crash How to set number of particles dynamically? - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Bug / Crash How to set number of particles dynamically? (/thread-2384.html) |
How to set number of particles dynamically? - vannorman - 25-07-2020 Hi, I have a vial of fluid that I'd like to dynamically fill up / empty using a single particle emitter. *I realize this thread topic already exists, but none of the other threads with this issue actually have a solution that works.* I cannot successfully control the total number of active particles from Obi Emitter. I tried setting the "max pool size" as suggested by @josemendez on another thread but this had no effect (sliding the slider all the way between 0 and 1). Setting the slider to 1 then killing all particles results in no new particles being created. Sliding it anywhere else and killing all particles results in the maximum number of particles being created. There is no in between. I just need to have a total particle count of 100 or so, then arbitrarily decide at runtime to only have 0, or, 20, or 55 of those particles active. Using DeactivateParticle causes the particle system to fritz out. What is the recommended way to set the number of active particles? Every method I've tried has resulted in bad behavior. RE: How to set number of particles dynamically? - vannorman - 26-07-2020 SOLVED: Don't know why this wasn't working for me before, but simply calling DeactivateParticle(index: 0) works to remove particles from the pool, and ActivateParticle(index: activeParticleCount) works to replace / add to the pool. |