- Home /
I have a particle system but I can't access it's particle emitter
I have a particle system object that I'm accessing with:
GameObject thrusterfire = GameObject.Find("thrusterfire");
I then try to activate it with:
thrusterfire.particleEmitter.emit = true;
but I get:
MissingComponentException: There is no 'ParticleEmitter' attached to the "thrusterfire" game object, but a script is trying to access it. You probably need to add a particleEmitter to the game object "thrusterfire". Or your script needs to check if the component is attached before using it. Move.Update () (at Assets/Move.cs:27)
Any advice?
Answer by robertbu · May 19, 2013 at 03:31 AM
Unity has two particle classes, ParticleEmitter (a legacy class), and ParticleSystem. If you look up the reference for GameObject you will see there is a variable for each. So if you added a ParticleSystem, then you want 'thusterfire.particleSystem', in addition, I don't think a ParticleSystem has an emit. What I think you want is:
thrusterfire.particleSystem.Play();
Your answer

Follow this Question
Related Questions
Particle emitter to emit "one-shot" on specific occasions 5 Answers
Particle emitter object destroys itself 2 Answers
Particles emitted from texture not appearing in game build. 1 Answer
ParticleEmitter script variables not found 1 Answer
Particle System Start and Stop GetKeyDown/Up Not Working 1 Answer