Im using a particle system for a ray of fire in my game. The length of my ray varies, so I had to figure out how to change the size of my particle system.
This approach works, but only in editor. When Im trying to build it complains that I cannot use UnityEditor.
You’ve discovered the wonderful world of “someone thought this level of API access was acceptable”! Fortunately there aren’t a lot of instances of this in the Unity engine, but the ParticleSystem class is… yeah, it’s pretty laughable. As far as I’m aware, you are pretty much SOL on that without getting a third-party particle system.
Fortunately, this issue is on the roadmap to be fixed in 5.3 (December) - might be worth trying to get ahold of the beta for that version.
Yeah I was kind of worried that this was the case. Sadly Unity 5.3 is coming in december and thats a long wait
The only other way to do this that I can think of would be to manually set the particle positions using some super complicated einstein level mathematical formula or just use a few different prefabs for different ray lengths.