19-12-2022, 12:40 PM
(This post was last modified: 19-12-2022, 12:40 PM by josemendez.)
(18-12-2022, 02:04 AM)mapleleaf4evr Wrote: Basically I don't want the particles to die until particle capacity is reached and then I only want them to die at a rate that is needed to continue emission.
Hi!
What you're describing is basically a ring buffer, am I correct?
(18-12-2022, 02:04 AM)mapleleaf4evr Wrote: From reading through these forums, I think this would be possible through emitter.KillParticle and setting lifespan to infinity. Is this the correct/most performance efficient way to implement this?
Yes.
(18-12-2022, 02:04 AM)mapleleaf4evr Wrote: I'm imagining that I would just write a script that checks if the number of particles is nearing max capacity and then starts to kill the oldest particles at the same rate they are being emitted. Can this just go in any old Update() function or is there a better place to put it?
Physics related stuff should generally be updated in FixedUpdate(). Obi allows you to change where solvers are updated though, trough the use of ObiUpdater components. To implement this properly regardless of where the solver is updated, you should do this whenever particles are to be emitted: during the solver's OnBeginStep event. See: http://obi.virtualmethodstudio.com/manua...olver.html
kind regards,