I’m using Unity 3.5, and I never really used the particle system before 3.0 was released. The ‘Particle System’ I’ve added in 3.5 seems to be a complete particle system, as described in the documentation… Animator, Emitter and Renderer in one System attached to my Game Object. I run the game and the particles are emitted as expected, so my lack of experience with Unity’s particle systems is making me second guess whether there is actually a particle emitter with the particle system that is seemingly emitting particles. The frustration comes from trying to loop through the particles in a script attached to the GameObject… the console claims that I do not have a particle emitter, even though my particle system is emitting particles.
I’ve tried :
Particle[] particles = transform.GetComponent<ParticleSystem>().particleEmitter.particles;
And :
Particle[] particles = GetComponent<ParticleSystem>().particles;
And :
Particle[] particles = particlesEmitter.particles;
No matter what I try, the console always says
‘There is no ‘ParticleEmitter’ attached to the “StarsGreen” game object, but a script is trying to access it.’,
Even though my particle system is clearly creating green stars on the screen. When I added the particle system, I went to the Heirarchy pane, clicked on the “Create” dropdown, and added a particle system. I checked Emission and particles are being emitted, I just can’t figure out how to access that emitter via code.