Is there a way to change the ellipsoid variable in the particle emitter through script. I tried:
GetComponent (ParticleEmitter).ellipsoid = Vector3.zero;
but an error popped up that said MissingFieldExecption: Cannot find variable ellipsoid.
Huh?
thanks
There is no way to edit the shape of the ellipsoid. However, you can manually emit particles in whatever pattern you like by using the variant of ParticleEmitter.Emit() that takes variables for position, velocity and so on.
You might then do something like this:
position = Vector3.Scale(Random.insideUnitSphere, Vector3(xScale, yScale, zScale));
particleEmitter.Emit(position, direction, 0.2, 2, Color.yellow);
That emits just one particle, so you’d have to do something (perhaps with a coroutine) to have it emit over a period of time.
Hmm. Isn’t ellipsoid just another variable, or is it a different kind of variable?
thanks
It just doesn’t exist from the point of scripting. Not everything that you see in the inspector is available for scripts to use, sadly.
I am still learning particle emitters, now taking what you have stated, can I give that emitter a life span? Say I wanted to have independent emitters trigger across a straight line starting at a random position and ending at a random position but a straight line between the two points, then have a life span of line 1 or 2 seconds (5 max), but random between that time.
Is this possible?
Yep, just have a script that yields for a random amount of time and then turn particleEmitter.emit to false. If Autodestruct is turned on, then the object with the particle system on it will destroy itself automatically as soon as all particles are gone.
–Eric