Is there any way to destroy a particle system after its done because the game crashes? This is my code:
if(playerInput > 0)
{
ParticleSystem a = Instantiate(particles,LeftRocket.position,LeftRocket.rotation);
}
else if(playerInput < 0)
{
ParticleSystem a = Instantiate(particles, RightRocket.position, RightRocket.rotation);
}
if (particles)
{
if (!particles.IsAlive())
{
Destroy(a);
}
}
}