Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Bug Case 1283120) Particle System "Rate Over Distance" doesn't work when moved in LateUpdate

Discussion in 'General Graphics' started by Peter77, Oct 6, 2020.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    5,316
    I don't know if this is by design, when I move a particle system that uses "Rate Over Distance" emission during the LateUpdate phase, it won't emit particles.

    In order for the emission to work, the particle system needs to be moved during Update instead.

    I'm using Unity 2018.4.27f1 and my test project is attached to this post. In the test project select "GameObject" in the Hierarchy and toggle the "Use LateUpdate" option.

    Is this worth a bug-report?
     

    Attached Files:

  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,342
    Hi,
    This is due to how we calculate the velocity of the particle system.

    Untitled picture.png
    PS.Update2 captures the old position.
    Ps.Update1 takes the current position and compares against the old
    So only movement that is between these 2 updates will be detected.

    We cant change how the velocity is calculated as its incredibly fragile code however we have added a new feature in 2021.1 that lets you set a custom velocity to the ParticleSystem, this lets you control the velocity and avoid these issues.
     
    Peter77 likes this.
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    5,316
    I see, that makes sense. Thank you for the rapid help, @karl_jones !
     
    karl_jones likes this.
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,342
    Peter77 likes this.
  5. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    5,316
    Thank you for giving it a second thought!

    Here is the bug-report:
    (Case 1283120) 2018.4: Particle System "Rate Over Distance" doesn't work when moved in LateUpdate
     
    richardkettlewell and karl_jones like this.
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,342
    Hey Peter,

    Looks like this issue has been fixed but there was a mistake on the backporting info.
    The fix has landed in 2018.4.29f1, I just verified it myself against your bug.
     
    richardkettlewell and Peter77 like this.
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    5,316
    Thank you!
     
    karl_jones likes this.
unityunity