Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Can timeline stop emission of particles?

Discussion in 'Timeline' started by dadude123, Apr 20, 2018.

  1. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Hello,
    I'm using timeline to orchestrate a pretty complex particle effect.

    The problem I'm having is that timeline simply destroys the particle system after the clip is done, instead of letting all existing particles die on their own and then destroying the system.

    In the selected track (5) I'm repeating a particle system as long as needed, when the cursor reaches the end of the clip, it instantly destroys the particle system.



    I already tried all the clip options like "Control Activation", and setting "Post Playback" to "Active" for example. But it doesn't make a difference.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,900
    Can you file a bug report? I recently made several changes to how timeline handles particles, it's worth looking into this as well.
     
    dadude123 likes this.
  3. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Just in case this is related.
    Here's what I think should be happening, maybe we can figure out where my approach is wrong (or maybe where there's really a bug).

    I have two tracks, one is a particle system that's set to loop.

    Track (5) selected in the screenshot has its particles "destroyed", like there's no wait to let the particles naturally fade out.

    The second track (track 6) is a particle system that is set to not loop, but I'd like timeline to repeat the particle system anyway. That the particle system is made in a way so it emits for 0.25 seconds and then stops. If set to "looping" it would look right, but then it gets cut off by the timeline. (the particle lifetime is short in this system, so simply repeating the system itself instead of letting it loop on its own works fine; of course this is a special case, and when the particles are supposed to live much longer, this approach won't work anymore)
    The problem with this track however is, that it cannot loop. There's no setting in the track that would allow me to override the particle systems looping mode. And when I select the track it shows "hold" when it gets extended. Probably because its gets its "loop or hold" value from the particle system. It would be nice if we could override that though.


    I will try to strip down one of our scenes a lot so it still works to show the problem and then file a report.
    Should I file two reports for the different cases? Or just one that deals with all of this?
     
  4. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    I reported a bug along with a project to easily reproduce it in: 1028367
     
    karl_jones likes this.
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,900
    Timeline does the looping by calculating the time and passing it into the particle system Simulate function, so it should be possible to just not loop the time value and go back to 0 after playing an iteration, although I'm a little unclear why you cant just do this with a looping particle system? Would it not be easier to create multiple control tracks for each loop point?
     
  6. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    You're right, it would be easier to just make it loop. The only reason why I even tried unchecking "looping" in the particle system was to try to find a workaround for the first problem. Thinking it would simply "pulse" the system once and then not cut it off.
     
  7. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    319
    Is there some way of doing this? I also need to make the timeline stop the particle system instead of killing it.
     
  8. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    174
    Is the Control Activation option enabled on the Control Clip? If you disable this option, the particle system should stop but will still be enabled.
    ctrlClip.png
     
    hdmtmt likes this.
  9. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    319
    @Julien
    I tried it, but It only works for non-looped ParticleSystems. For looped, it doesn't stop, it keeps playing.
     
  10. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    319
    I was able to work around this by adding a key to ParticleSystemActive and setting it on and off.
     
  11. AdultLink

    AdultLink

    Joined:
    May 20, 2017
    Posts:
    4
    Is there any update on this issue? Seems like it's still happening on 2018.3.0f2.

    It's a pain in the ass since instead of a simple control track, now I have to write play and stop methods and call them through keys, which is bad for timeline readability, not to mention it takes longer. Quite an ugly workaround to be honest.
     
    jimmyjamesbond likes this.
  12. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    319
    Try A adding a key to ParticleSystemActive and setting it on and off on the TimeLine. You will need to double click to edit the track on animator.
     
  13. Arycama

    Arycama

    Joined:
    May 25, 2014
    Posts:
    182
    I'm also having issues with this still, ended up writing an entire custom playable track/mixer/clip system to work with built-in particle systems. Also I can't see any updates planned on the roadmap or similar, despite finally getting support for things like actually being able to change volume/panning for audio clips in 2019.

    To recap, a control track will start the particle system but disable the gameObject at the end, which causes the particle system to completley disappear instead of letting remaining particles die on their own.

    Alternatively, if you tell the control track not to disable the gameObject on completion, the particle system is just paused at the end and the particles remain visible indefinitely.

    Having to write a bunch of custom code to handle this should not be necessary.
     
  14. jimmyjamesbond

    jimmyjamesbond

    Joined:
    Mar 17, 2015
    Posts:
    19
    It feels like I'm missing something. I mean, if you're Unity creating a particle control track the first thing you would do is play and stop, right?
     
    TonyBaidzionakFL likes this.
  15. snoche

    snoche

    Joined:
    Feb 22, 2010
    Posts:
    82
    I am having the same issue, I start an intro with a particle that should be looping until I disable from another timeline but I can not make the particle to stay on and working. Any update or roadmap for this fix?
     
  16. jimmyjamesbond

    jimmyjamesbond

    Joined:
    Mar 17, 2015
    Posts:
    19
    Just checking in a year later and I still can't play particles with timeline effectively. Sub-emitters, looping issues, stopping and clearing, stepping during timescale, etc etc. Is there a plan to work on this or should I invest more time into my own custom track? I would like to use something native if that's in the works.
     
  17. olejuer

    olejuer

    Joined:
    Dec 1, 2014
    Posts:
    210
    As a workaround, I attach an Animator Component to my ParticleSystem and animate the Emission of particles with a recorded animation track. It is quite manual, but it does work and allows for proper Timeline preview.
     
    memosagame likes this.
  18. TonyBaidzionakFL

    TonyBaidzionakFL

    Joined:
    Aug 15, 2022
    Posts:
    3
    I found another workaround. I working in 2021.2.10f1.

    We can create signal track on the timeline. When we add object with particle system on it signal reciever will be created on that object. There we can add reaction ParticleSystem.Stop with Editor/Runtime parameter.
    Works for me.
     
  19. olejuer

    olejuer

    Joined:
    Dec 1, 2014
    Posts:
    210
    The advantage of an animation over this is that the emission will be toggled correctly when jumping through the timeline.
    When you have a script that changes the time of timeline or you skip through it in the editor, events will not set the emission correctly.

    You will also need a signal asset, but that's a minor inconvenience and it can be circumvented with custom scripts.

    But when you want to keep the particle system playing after a control track (or the entire timeline) ends, you can do it with a signal event.

    Still wish unity would add a post-track-behaviour flag to the control clip.