function Update () { // if the key is held during this update, we "toggle" the enabled value if (Input.GetKeyDown(KeyCode.W)) { particleEmitter.emit = !particleEmitter.emit; } }
Above is the code to turn the particl eemitter on and off. I have W for moving forward, and so the desired effect is while moving, particle emit, while not, particle stop, but i've tried;
GetKey GetKeyDown GetKeyUp
and none produced the desired results, they all either skipped turning off, skipped turning on, or just turned off/on at different times.