I’m trying to instantiate an explosion particle system without playing it immediately (and I will call the
play()
function to play it later), here is my code:
// my GameManager Awake function
private void Awake()
{
GameObject explosion = Instantiate(explosionPrefab);
ParticleSystem[] pss = explosion.GetComponentsInChildren<ParticleSystem>();
foreach (ParticleSystem ps in pss)
{
ps.Stop();
}
}
Note that the explosionPrefab
is the very prefab “explosion” in the standard assets → ParticleSystems → Prefabs. I’ve toggled off all of the “play on awake” in its paricle system children, but it still plays when instantiating it. How to disable the playing when instantiating it? Thanks.