I’m trying to use a script to change some parameters on a particle effect, but not having much luck with the proper way to write it.
As a test, I’ve created a particle effect using GameObject>Create Other>Particle System and then parented it to an empty game object called Smoke. I then attached a script to the object “Smoke”, that contains the following:
function Update () {
particleEmitter.minEmission = 200;
particleEmitter.maxEmission = 200;
}
This of course doesn’t work, and I get various errors depending on the different things I try. I’m still pretty new to all this, so I haven’t had much luck trying to infer how to correctly do this from the scripting resource docs. All that document does is define what the various parameters do. It doesn’t give any examples of actual code.
How do I write this so that it sends the Emission instruction to the particle system attached to “Smoke”?