Problems with mesh particle emitter

Hi, I have a mesh particle emitter and I want to make it enabled when pressing space. So, I tried:

`

var torus : GameObject;

function Start () { torus.particleEmitter.enabled = false; }

function Update () { if(Input.GetButton("Jump")) {torus.particleEmitter.enabled = true;} else { torus.particleEmitter.enabled = false;} }

`

But it doesn't work. How can I do that?

-H.

instead of

torus.particleEmitter.enabled = false;

you should do

torus.particleEmitter.emit = false;

and to turn it on, you would do

torus.particleEmitter.emit = true;

so your whole script according to what's currently posted, would look like:

var torus : GameObject; 

  function Start () 
  {
     torus.particleEmitter.emit = false;
  }

  function Update ()
  {
     if(Input.GetButton("Jump"))
    {torus.particleEmitter.emit = true;}
  else
  {
     torus.particleEmitter.emit = false;}
  }