Particle System - Delay before emitting

Hello All.

I’ll try and keep this descriptive and distinct.

I’m controlling a particle system with code, to represent a burst of gas coming from a astroid.
If the mouse/finger is down the particle system switches on, if it’s up it stops. Simple right?

The Particles System has been created and added to the game in the Editor, all working fine, the physics is set to World Space, and ‘Start Delay’ is 0. (There’s more settings, happy to provide if relevant).

Having switched off the system on Start() I use the following code to update switch back on and off the emitter.

void UpdateJet() {
	if (propelled) {
		Debug.Log("ON Particles");
		if (jet.GetComponent().isPlaying != true) {
			jet.GetComponent().Play();
		}
	} else if (!propelled) {
		Debug.Log("OFF Particles");
		jet.GetComponent().Stop();
	}
	
	jet.transform.position = transform.position;
}

Looking at the Console I’m certain the code is reacting fine for switching on and off.

The problem is that although the first time it kicks in the particles work fine, and depressing works too, the second and further times I start the emitter there is a delay of about a second before the stream kicks in again. Why?

I anyone can point out the area I should be looking to work this out appreciated.

Ha! Didn’t think this would ever be active.

I think in the end I had to do this a different way. But the particle system has totally changed since this post, so it’s likely irrelevant anyhow.

Glad you sorted it.