Search Unity

Particle System stopping and playing causes a weird behaviour

Discussion in 'General Graphics' started by waxx, Jan 3, 2020.

  1. waxx

    waxx

    Joined:
    Apr 1, 2013
    Posts:
    48
    Hi.

    I've got a particle system that I Stop and Play in order to pause/resume emission and I've ran into this weird behaviour where the Play function sets the internal isPlaying variable to true instantly, but doesn't actually start emitting new particles. Instead, the system waits until its particles count drops down to zero (thus "finishing" the last Stop) and only then it picks back up again and starts emitting new ones. This is a bit odd, I'd prefer the Play() function to start playing immediately. Is there anything I can do to change this behaviour?
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    There is a parameter you can pass to Stop to make it stop instantly.
     
  3. waxx

    waxx

    Joined:
    Apr 1, 2013
    Posts:
    48
    This parameter destroys all the remaining particles. What I want is an option to pause (while still simulating the existing particles) and resume emission.
     
  4. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Turn the emission module on and off?

    Code (CSharp):
    1. var emission = ps.emission;
    2. emission.enabled = toggle;
     
    MattThomSA likes this.
  5. waxx

    waxx

    Joined:
    Apr 1, 2013
    Posts:
    48
    Oh, I thought this was already not used. Thanks.
    Although the Stop/Play behaviour is still a bit confusing.
     
    AlejMC likes this.
  6. AlejMC

    AlejMC

    Joined:
    Oct 15, 2013
    Posts:
    149
    Agreed, the 'stop' enum offers StopEmittingAndClear or StopEmitting, doesn't sound like it will pause the whole simulation at the same time.
    Trying the emission enabling options.