Particle System Main Module
I'm trying to change the start lifetime of a particle system in Unity v5.5.1. This code throws a NullReferenceException when trying to assign to startLifetime. I know that _particleSystem and _particleMain are NOT null.
_particleSystem = GetComponent<ParticleSystem>();
_particleMain = _particleSystem.main;
_particleMain.startLifetime = new ParticleSystem.MinMaxCurve(_gameManager.TicksPerNight / 32f);
Following the examples here has not led me to any conclusions. Is this the proper way to assign to startLifetime in the MainModule? If so, why is it not working?
It's difficult to tell the issue when the code given is so incomplete.
if the portion you posted throws NULL, your assumption about not NULLs is wrong. find out what exactly is null and why it's null. if you get that error there's no denying
Did something dumb. Apparently there was no ParticleSystem on the object, but it was creating one. I checked the value in debug mode (below).

After changing the code to retreive the ParticleSystem from another gameobject, it fixed the issue.
Your answer