- Home /
Question by
flaviusxvii · Sep 12, 2016 at 02:35 AM ·
particlesystemdistanceemission
Particle System using distance emission stops emitting when script active..
I have a script that adds turbulence to particles and it works find for a time-based emission particle system, but If I switch the system to distance-based emission it doesn't emit. The relevant chunks of script:
ParticleSystem ps = null;
ParticleSystem.Particle[] particles;
protected Generator noise = null;
void Start () {
if(noise == null) {
noise = new PinkNoise(556);
}
ps = GetComponent<ParticleSystem>();
particles = new ParticleSystem.Particle[ps.maxParticles];
}
void LateUpdate () {
int ptotal = ps.GetParticles(particles);
for(int i = 0; i < ptotal; i++) {
Vector3 ppos = particles[i].position;
particles[i].position += noiseMagick(); // Trust me, it works when using time based emission..
}
ps.SetParticles(particles, ptotal);
}
I've searched google to no avail. Any clue what's happening?
Comment
Your answer
Follow this Question
Related Questions
Shuriken "Distance" emission mode not working 1 Answer
Emit particles by distance of parent 2 Answers
Particle delay 1 Answer