Hello. I have a bit of problem getting a simple burst particle system to work. To reproduce the issue, create a new Particle System, set Duration and Start Lifetime to 1, then under Emission set Rate to 0 and add a Burst with the default settings. Disable Looping and Play On Awake.
Then, I’d like to drive the burst through code. A simple demonstration could be per mouse click.
using UnityEngine;
using System.Collections;
public class PlayParticles : MonoBehaviour
{
void Update ()
{
if (Input.GetMouseButtonDown (0)) {
var ps = GetComponent<ParticleSystem> ();
ps.Stop ();
ps.Clear ();
ps.Play ();
}
}
}
I would expect that on each mouse click, a burst is played. This works until the particles disappear. After particles have disappeared, calls to Play does nothing. However, if I change simulation space to World, then Play works as intended. The problem is that I require local space simulation.
How can I make the particle system play more than once, after the initial particles have disappeared?
I’m using Unity 5.3.2f1