I feel like this code is really close to doing what I need to do. I have an empty game object with all the things needed for a particle effect that is the child of another mesh. What I want it to do is to make the emitter emit for a time when I press the 1 key on the numpad, and then have the emitter turn off. This isn’t as fluid as I want it, however it’s the best I can do for now.
The Code:
var emissionTime : float = 3.0;
var emissionDelay : float = 3.0;
function Start() {
TimedEmit();
}
function TimedEmit() {
GetComponent(ParticleAnimator).autodestruct = false;
if (Input.GetKeyDown ("[1]"))
particleEmitter.emit = true;
yield WaitForSeconds(emissionTime);
particleEmitter.emit = false;
yield WaitForSeconds(emissionDelay);
}