- Home /
Question by
Bhanuka_Dassanayake · Oct 01, 2021 at 01:59 PM ·
particlesystemparticle emitter
How to turn on/off particle system?
hi,
I'm making engine. and it's constantly working. ( on/off every time)
so I use this code,
public void engineEffect(float up, float forward, float right)
{
var emissionUp = upParticle[0].emission;
var emissionDown = upParticle[1].emission;
if (up > 0)
{
emissionUp.enabled = true;
emissionDown.enabled = false;
}
if (up < -0)
{
emissionUp.enabled = false;
emissionDown.enabled = true;
}
}
that up value change it's value -1 to 1 I need to enable those particles. but it don't work. it's enabled the emission. but I can't see my particles.
Comment
Answer by kolalex01 · Oct 02, 2021 at 11:01 PM
Hi @Bhanuka_Dassanayake!
You should refer to your Particle Systems and play them with Unity's method, ParticleSystem.Play();
You may want to check the documentation of particle systems for more detailed info, but I'm happy to help you out. :)