Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  How to set number of particles dynamically?
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.
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.