Search Unity

Particle Trails acting strange after removing script emitted particle

Discussion in 'General Graphics' started by MadboyJames, Jun 2, 2022.

  1. MadboyJames

    MadboyJames

    Joined:
    Oct 28, 2017
    Posts:
    262
    Hi, I have a projectile system that uses particles as projectile graphics. I use Emit() from a script to control the emission of these particles. I have run into an issue with trails. Observe:

    1: projectile "rocket" is seeking the cube object. Trails working fine
    upload_2022-6-2_13-3-39.png

    2: Projectile "runs out of fuel", stops seeking and flying. Trails still working fine.
    upload_2022-6-2_13-5-15.png

    3: Projectile plummets downward. Trails working fine.
    upload_2022-6-2_13-6-48.png

    4: Projectile lifespan expires, and script updates the lifetime of the expired particle to -.1f and applies the change through SetParticles(). Trails no longer working fine. The trail of the removed particle is now attached to the last fired particle. Next frame, this happens to every particle.
    upload_2022-6-2_13-7-46.png

    5: Next frame (well, about 10 frames for the sake of graphical clarity, but the issue happens after the first)
    upload_2022-6-2_13-12-22.png

    Is this a bug? Do I need to handle trail index when I remove a particle? Anyone have any idea what is going on? Am I just not supposed to use the particle system this way, and the trails are just a symptom of this?

    Any help, advice, or suggestions would be appreciated.
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    This sounds like a similar bug report I saw recently but haven’t yet figured out a way to solve it. Are you able to submit a report in case your situation is different?
     
  3. MadboyJames

    MadboyJames

    Joined:
    Oct 28, 2017
    Posts:
    262
    Sure. I don't think I can strip down my code a whole lot, but I'll submit the bug.
     
  4. MadboyJames

    MadboyJames

    Joined:
    Oct 28, 2017
    Posts:
    262
    Bug submitted!
    IN-5242
     
    richardkettlewell likes this.