Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(noob question) how to find and set numParticles
#1
In the forums I can see references to people setting 'Num Particles' somewhere in the emitter code, but I can't find that variable anywhere in the emitter or anywhere else.
I can get the max number of particles from...

Code:
thisEmitter = GameObject.Find("Emitter");
numParticles = thisEmitter.GetComponent<Obi.ObiEmitter>().particleCount;

But 1. that's a private read-only variable, and
2. I can't find where it's initialized in the first place (which makes me feel like a totaly idiot).

Can someone point me to where I need to go? 
Thanks.

###### edit #######
nevermind, this seems to be handled within the blueprint. I'll leave this for anyone else who ever has issues finding this.
Reply
#2
(04-03-2020, 08:28 PM)geschaftsreise Wrote: In the forums I can see references to people setting 'Num Particles' somewhere in the emitter code, but I can't find that variable anywhere in the emitter or anywhere else.
I can get the max number of particles from...

Code:
thisEmitter = GameObject.Find("Emitter");
numParticles = thisEmitter.GetComponent<Obi.ObiEmitter>().particleCount;

But 1. that's a private read-only variable, and
2. I can't find where it's initialized in the first place (which makes me feel like a totaly idiot).

Can someone point me to where I need to go? 
Thanks.

###### edit  #######
nevermind, this seems to be handled within the blueprint. I'll leave this for anyone else who ever has issues finding this.

Solvers have a pool of particles, from which actors "borrow" particles. In 4.X, the size of the pool had to be set explicitly. In 5.X, solvers automatically resize the pool depending on how many actors they have and what their needs (in terms of amount of particles) are.

So if you're using 5.X, you don't really have to worry about setting the amount of particles in an actor/solver. When you create a blueprint, the blueprint stores the amount of particles it needs, and requests that amount to the solver upon instantiation. If the solver pool does not contain enough "free" particles to create an instance of the blueprint, it will make the pool grow.

For other Obi assets (cloth, ropes, and soft bodies), the amount of particles in a blueprint is automatically calculated. In the specific case of fluids, you manually set the amount of particles (capacity) of the blueprint. See: http://obi.virtualmethodstudio.com/tutor...rials.html
Reply