Having a particle emitter spawn - fully emitting

I think I saw that this is possible somewhere, but cannot find the post.

If my character equips a flaming sword, I don’t want the emitter to slowly start emitting along the mesh, I want it to appear as it has always been emitting, is this possible?

In other words when I enable an emitter is there a way to have it not slowly start emitting but rather appear it is in the middle of emitting (make sense?).

And no, I cannot have it emitting somewhere off camera and then move it suddenly in place.

ParticleEmitter.Simulate() is supposed to do this, although the results when I tried it weren’t really what I expected, but it might be good enough in some cases.

–Eric

thanks Eric. I will mess with it and see what I can do.

Does anyone know how this function really is supposed to work? If I read the docs correctly it is suppose to advance the particle simulation by a specified amount of time… but it don’t?! :?

Ahh…
particleEmitter.Simulate(Time.time + 10.0f);
But it didn’t give me the result I was expecting :frowning:

It appears to be a one shot deal, rather than doing the iteration for you.

Try like this:

var iterations = 20;
var stepSize = 0.1;

function Start () {
	for(i=0; i < iterations; i++) {
		particleEmitter.Simulate(stepSize);
	}
}

Aha, great insight! This works very well, thanks.

–Eric

That makes the function a little less interesting than I thought it was. It would be nice if it did the math and simulated in a single step. That should be faster and perfectly possible if you’re not interested in collisions.

Still, it beats the “Time.timeScale = 99.9; yield WaitForSeconds(x); Time.timeScale = 1.0;” hack I’d been using earlier, and you could use Simulate in the middle of gameplay (unlike the timeScale hack), so it’s much better than nothing.

–Eric