I have a prefab with a particle system attached. In the code I play the particle by using this code

            ps.enableEmission = true;

When i run the game, and that code executes, the particle emitter does not emit anything in the "game" window unless i press simulate button in the "scene" window.

Anybody knows why?

share|improve this question
1  
You should edit your question with more information about your code and implementation. It is hard to help you debug your code with so little information. Besides, it is not very clear what exactly you meant in your second paragraph there. – MAnd Feb 24 '16 at 3:01
    
What simulate button is in the scene window? I think the Unreal Engine has a simulate button... – Ageonix Feb 24 '16 at 3:13

For the emission property to work the particle system has to actually be playing. To do this you can either enable Play On Awake in the ParticleSystem component or you use the Play method on an instance of the component.

As a side note, if you are using 5.3+ the enableEmission property is now obsolete and you may want to consider using the emission property. One thing to keep in mind when using this property is you have to assign it to a variable before attempting to modify it:

public ParticleSystem _ps;
...    
private void Update()
{
    ParticleSystem.EmissionModule module = _ps.emission;
    module.enabled = true;
}
share|improve this answer

Yea, it is difficult to handle it like this.

Just mark it as Play On Awake, set any duration (no unlimited life), make prefab and instantiate it instead of Play or Enable

share|improve this answer

set the particle system as Play on Awake, and disable the particle system. set it active when you want to start and de-active when you want to stop.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.