What I’m trying to achieve here is that I got 2 ParticleSystems on a moving vehicle, And when they emit smoke the particles follow the emitter as it moves. I’d like them to stay in same position with the same velocity even if the emitter moves and keeps emitting particles.
This is the code for the emitters:
var emitter1 : ParticleSystem;
var emitter2 : ParticleSystem;
var emitter1pos : GameObject;
var emitter2pos : GameObject;
...
if(emitter1.isPlaying)
emitter1.transform.parent = test.transform;
emitter1.transform.position = emitter1pos.transform.position;
emitter1.transform.rotation = emitter1pos.transform.rotation;
if(emitter2.isPlaying)
emitter2.transform.position = emitter2pos.transform.position;
emitter2.transform.rotation = emitter2pos.transform.rotation;
...
emitter1.particleSystem.Play();
emitter2.particleSystem.Play();
The test object was just to try to get the particles parent to be in a empty GameObject to keep them in place, But it didn’t work.