- Home /
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.
Answer by Jesus_Freak · Dec 02, 2010 at 07:59 PM
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;} }
Your answer
Follow this Question
Related Questions
Specific Game Object - Particle Emitting 0 Answers
how to fix mesh particle emitter sorting issue with parent object ? 0 Answers
Particle Effect (Shuriken) mesh emitter how to? 1 Answer
Particle System (shuriken) with mesh particles, change color? 0 Answers
How does one access the mesh variable of a Mesh Particle Emitter? 2 Answers