- Home /
How do you use enable.emission for particles in 5.3?
I updated to 5.3 and it says that enableEmission is deprecated and to use enable.emission instead. I cannot find any documentation on how to use the new format. Could somebody please help.
Answer by SaraCecilia · Jan 07, 2016 at 11:39 AM
Hi, check out this page: http://docs.unity3d.com/ScriptReference/ParticleSystem-emission.html
ParticleSystem ps = GetComponent<ParticleSystem>();
var em = ps.emission;
em.enabled = true;
Answer by $$anonymous$$ · Apr 26, 2016 at 07:35 PM
I'm using 5.3.4f1 and the code above does not work -- it compiles without warning, but setting em.enabled does not actually affect the particle system emission.
The Unity manual does show the code above as an example; perhaps it used to work and they broke it when they changed some classes to struct to reduce gc?. (As noted here http://answers.unity3d.com/questions/1109509/unity530f4-particlesystem-emission-property-is-rea.html it was bizarre that it ever worked if em is a struct)
I had to revert my code back to the old deprecated method:
ps.enableEmission = enableEmission;
I'm using the deprecated method too. Sometimes there is no time to do a good research about the changes that are being done in Unity. I will continue using this method until it's removed.
@$$anonymous$$
Your answer
Follow this Question
Related Questions
Trouble with particles after updating to 5.3 1 Answer
Draw Particles over Text (GUIText or GUI.Label) 3 Answers
how to add a script ? 1 Answer