How do I start particle emission in c#?

Hi, I’m following a begginer’s tutorial (since I have just started with programming). The Idea is that when the player aproach a collider, the particle emission should start. This is the code:

void LightFire (GameObject campfire)
		ParticleEmitter[] fireEmitters;
		fireEmitters = campfire.GetComponentsInChildren<ParticleEmitter>();
		foreach(ParticleEmitter emitter in fireEmitters)
			emitter.emit = true;


Everything else in the code is run smoothly, the audio starts and the GUITexture is destroyed, but the emitters won’t start. Can Someone tell me why?


It’s one of the following most likely:

  1. fireEmitters is coming back null. Which means the children in your campfire game object do not contain any ParticleEmitters.

  2. The emitters are there, but they are not active (as in enabled, not as in emitting).

  3. The emitters are there and emitting but not where you think they are in the scene (maybe they somehow got moved to another part of the world)

  4. The emitters are emitting particles in a render layer that is not being rendered by the current camera (it’s cull mask rejects them).

  5. Lighting is wrong in the actual game but works fine in the Scene editor (so you see it in the scene and not in the game). For this one, you should be able to select the emitters on the campfire gameobject in the scene editor while the game is running and see quads rising up as particles

  6. The particles are so small you can’t see them in-game.