Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generate burst by script? Is this the normal behaviour in Burst mode?
#1
Hi,

I've tried out settings in Burst mode to simulate shampoo coming out of the bottle.
But it seems I can use the emitter's speed the same way as with Stream.


-How can I generate a burst via script, without waiting for current particles to disappear? 
I tried ObiEmitter.EmitParticle, but it only emits one particle. I'd like to emit the entire capacity of one Burst.

I want to be able to generate many bursts in a row from script, and have the fluid accumulate underneath.


Also, even when I set emitter's speed to 0, particles are still flowing, and are generated every "lifespan" seconds. Is this the normal behaviour in Burst mode?

Thanks
Reply
#2
Hi there,

The emitter speed is used in both modes, as it defines the speed of the particles being emitted.

To emit a single burst by code, you can call EmitParticle() as many times as distribution points there are in your shape:

Quote:int emissionPoints = GetDistributionPointsCount();
for (int i = 0; i < emissionPoints; ++i)
{
    EmitParticle(0,stepTime);
}

unsurprisingly, this is exactly the same that Burst emission does internally Guiño (BeginStep() method of ObiEmitter.cs). The only difference is that Burst mode waits until the amount of active particles is 0 (all particles are dead) before emitting again. So, the behavior you describe is the intended one: burst, wait for all particles to die, then burst again.
Reply