Im trying to understand this below. Im adjusting to basically shoot a burst of particles when the player enters a collider. It works fine, but its just a burst and obviously the example given in documentation. Code (CSharp): public class ParticleTrig : MonoBehaviour { void OnTriggerEnter2D (Collider2D other) { if (other.gameObject.tag == "Player") { Debug.Log ("Emit"); ParticleSystem ps = GetComponent<ParticleSystem>(); var em = ps.emission; em.enabled = true; em.type = ParticleSystemEmissionType.Time; em.SetBursts( new ParticleSystem.Burst[]{ new ParticleSystem.Burst(1f, 10), }); } } } So here is the question, under "new ParticleSystem.Burst(1f, 10)," How would I make it only "burst" once? Currently when you enter, it shoots 10 particles out at the same time, which is fine, BUT it keeps shooting them every 1f. (Obviously because Burst( has a float _time, and a Short _count)) Thats what leads me to believe it should be a burst, but something else. Sorry for the lack of knowledge here, I've been searching all night and can't seem to search the correct word to solve what i want.
Thanks for the response, I tried using it within the code above to no avail. the only thing its doing is making the particle system stop completely and not burst once. I added the code into em.SetBursts(). is that not the place? Im just not understanding whats going on i think.
You'll probably want to set it earlier with "ps.loop = false;" The whole particle system will loop, the bursts are within the emission module inside the particle system. So if you have one burst, the particle system will loop after each lifetime, and continue playing that single burst. So you set the whole particle system not to loop, not inside "SetBursts".
I finally gave up on looping (it was working, but it wasn't exactly what i wanted.) I did more research into .Emit which is a PAIN to figure out. http://answers.unity3d.com/questions/1124163/particlesystememitparams-unity-53.html Code (CSharp): void OnTriggerEnter2D (Collider2D other) { if (other.gameObject.tag == "Player") { Debug.Log ("Emit"); ParticleSystem ps = GetComponent<ParticleSystem>(); ParticleSystem.EmitParams emitOverride = new ParticleSystem.EmitParams(); emitOverride.startLifetime = 10f; ps.Emit(emitOverride, 20); } } So for anyone who needs a script the emits a particle when the player enters a 2d collider, here you go! Thanks for the help everyone!