Search Unity

Particle System Prevent Particles from Dying

Discussion in 'General Graphics' started by victorML, May 24, 2019.

  1. victorML

    victorML

    Joined:
    Jul 5, 2017
    Posts:
    38
    Hello, my name is Víctor and I present the following problem.

    I have a Fairy Glowing Effect with particles. I got the desired effect at the beggining of "Play" but somehow particles are dying by time, maybe they last with full visibility 5 seconds and then starts fading out.

    I have fading effect with Color by lifetime but even if I disable it particles go dissapearing.

    What I want is to keep the intensity of particles constant all the time. How can I do ? I tried refreshing remaininglifetime by code and also vi particleSystem.Play() ever x seconds in coroutine.


    0.5 printed is remaininglifetime that I'm reseting all the time.
    Second picture is intensity at the beggining.
    First picture is itensity at when few seconds pass.

    EDIT: I have two particle system attached on different GameObjects.
    One emits the spheric bright, the other one emit small particles as points.
    The one want to keep constant all the time is the spheric bright.
     
    Last edited: May 24, 2019
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    You can type "Infinity" into the Start Lifetime field in the Inspector to make your particles last forever.
     
  3. victorML

    victorML

    Joined:
    Jul 5, 2017
    Posts:
    38
    It tell me this error:
    Precision issue while prewarming particle system - 'Duration' or 'Start Lifetime' is likely a too large value.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr

    If I disable prewarm option, particles are not seen.
    Also, rest of things are like this



    If I unable Size over Lifetime, particles don't dissapear but size of particles doesn't look good.
    EDIT: Okey, I noticed that particles are not dying, the problem is that they are getting smaller and invisible. Invisible thing is solved but if I unable size over lifetime I don't achieve the effect I want.
     
    Last edited: May 24, 2019
  4. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Try randomizing initial size instead of size over lifetime.
    As well as start color instead of color over lifetime.

    And disable prewarming.
    On long lifetime it causes very significant performance drops.

    Instead use Emission -> Bursts to spawn required amount of particles. Also disable rate over time.
     
    ObiOneStenobi likes this.
  5. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Infinite lifetime cannot be used with any "over lifetime" properties. If you need particles to change during their lifetime, they cannot last forever, otherwise how do we know how far along the color gradient + size curve to read?

    Re: prewarm and that error. I think you hit a bug, sorry. We will look at fixing it.

    If you need your particles to change over their lifetime, but also want them to last forever, then I'm confused about what you're trying to do. Your size curve animates them to 0 size over time, so I must have misunderstood what you're actually trying to do here.
     
    Naver78 likes this.
  6. riverdore

    riverdore

    Joined:
    Jul 21, 2012
    Posts:
    25
    He's trying to keep a particle around while having a 'fade in' effect when they spawn.
    I'm having the exact problem, my app has tasks which are represented as particles. I need them to stay around (or at least a long time, say 1000 seconds) while having fading them in, or at least altering it's size the first second.

    However the curve graph becomes increasingly difficult to use the longer the lifetime.
     
    Last edited: Jul 20, 2019
  7. riverdore

    riverdore

    Joined:
    Jul 21, 2012
    Posts:
    25
    The only solution I found is using texture/sprite sheets for a 'fade in' or any effect you're looking to make on top of keeping a long lifetime



    If you want a fade in/fade out effect while having an inf time for your particles.
    Make two sheets, one that does a fade in, then one that does a fade out.

    When you need a particle to do an effect you can easily make that happen by just changing the texture sheet when you want in a script.
     
  8. woo37830

    woo37830

    Joined:
    Aug 11, 2020
    Posts:
    1
    I have a similar problem where I want smoke particles to pool against a ceiling or tunnel top. The smoke is coming in 5 second "puffs". If I make the lifetime Infinity or even 50 seconds, I don't get another "puff" until the 50 seconds has expired. I want puff, (pooling smoke), puff ( further smoke pooling), puff ... I can adjust the life time so the smoke from a puff goes away after some reasonable time, but I want several "puffs" of smoke to accumulate before this happens.
     
  9. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Sounds like maybe you reached the Max Particles limit? It’s in the main particle inspector, try increasing it.

    The scene view particle info will also tell you how many alive particles there are, on a selected playing effect, giving you a good idea of whether this is the problem or not.
     
    karl_jones likes this.