Am I missing something here or is my Unity editor bugged? I cannot for the life of me figure out how to turn a ParticleSystem on/off in my scripts. I have tried all of the following pairs:
public ParticleSystem trail;
trail.enableEmission = true;
trail.enableEmission = false;
trail.gameObject.SetActive(true);
trail.gameObject.SetActive(false);
ParticleSystem.EmissionModule em = trail.emission;
em.enabled = true;
em.enabled = false;
None of these work. And I’m not getting a null reference either, I am positive I have correctly assigned the proper ParticleSystem to the variable “trail”.
On top of this, I’ll be testing things when I hit Play and suddenly I find that my ParticleSystem has just disabled itself for no reason. Sometimes when I press play it’s on, sometimes when I press play it’s off.
I am using Unity 2019.3.15f1. Is this an error on Unity’s part and should I re-download my editor? Or am I missing something painfully obvious? Thanks!