For some reason, when I run this code:
void Update()
{
if (gameObject.GetComponent<Rigidbody>().velocity.y <= -10)
{
Vector3 vel = gameObject.GetComponent<Rigidbody>().velocity;
vel.y = -10;
gameObject.GetComponent<Rigidbody>().velocity = vel;
gameObject.GetComponent<ParticleSystem>().Play();
} else
{
gameObject.GetComponent<ParticleSystem>().Stop();
}
}
The particles never start.
However, if I change gameObject.GetComponent<ParticleSystem>().Stop();
to gameObject.GetComponent<ParticleSystem>().Pause();
it works perfectly fine. I don’t want to use Pause(); I want the particles to completely dissapear, but be able to reappear!
How can I do this?