Hi
Creating a smoke effects with particles, when a flying object is close to the ground, I want to make it disappear when this object is far from it too. If I use a
groundSmoke.gameObject.SetActive (false);
I will make it immediately disappear, it’s working, but it’s not what I want, because smoke don’t trigger “off” in 1 frame.
so I try to use ParticleSystem.startLifetime to set up the life time of paticles to 0
myparticles = groundSmoke.gameObject.GetComponent<ParticleSystem>();
myparticles.startLifetime = 0;
It “working”, BUT I have still one particle flickering on the screen (probably appearing and dying immediately).
Anyone would know how to resolve this?
Second question, I now need to get the right values again on this particle system the next time the flying object will be close to the ground again.
myparticles= groundSmoke.gameObject.GetComponent<ParticleSystem>();
myparticles.startLifetime = 1;
but is it possible possible to place two values instead of this “1”, to get back to my setup with a “Random between two constant”, allowing my particles to live between 1 and 3 seconds for instance?
Thx.