Search Unity

Bug No more re-spawn after particle death and some strange problems

Discussion in 'Visual Effect Graph' started by Personuo, Jul 18, 2022.

  1. Personuo

    Personuo

    Joined:
    Mar 19, 2014
    Posts:
    129
    When I was learning VFXGraph, I immediately ran into frustration, and I don't know if anyone else has found this to be a problem. I don't know how to describe it, I can only post a video and pictures out of it.

    this is a so easy example, but you can find some error results.
    1.No more re-spawn after particle death.
    2.The position of the first vertex of the first strip, which is changed continuously in the following



    YU{ZVA$98RQR{U%ZAQW_`G4.png
     
  2. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    That does look super weird and I do not really get the bug either, but I am curious.
    The setup does look very similar to simple heads and trails though?
    What's the point of sending Trigger Event on Die 32 times? It is the same value as Capacity, but wouldn't that mean that every particle upon its death sends 32 events? (32 * 32 if they all die in the same frame)?
     
  3. Personuo

    Personuo

    Joined:
    Mar 19, 2014
    Posts:
    129
    Do you mean that you set it up the way I did and the result is correct? Not the same as me?

    About 32, I just wrote it at random when I was testing which parameter was wrong,no definite meaning
     
  4. Marie_G

    Marie_G

    Unity Technologies

    Joined:
    Mar 9, 2021
    Posts:
    76
    For the particles that stops spawning, it seems to be because your child particles (the line) don't have a lifetime, so they live forever and reach the max capacity, preventing the rest of the particles to spawn again. Can you try with a set lifetime node?
    For the weird position offset, can you show you output? Nothing in the rest of the graph seems to be causing this result.
     
    VladVNeykov likes this.
  5. Personuo

    Personuo

    Joined:
    Mar 19, 2014
    Posts:
    129
    This is a very, very simple case, I have shown all my modified nodes, output did not add any nodes
    1. If I add a lifetime to paritclestrip, only these 2 particles will re-emit when the paritclestrip particles die (because my strip capacity is set to 2). The remaining 30 particles exist forever in memory because of the failure of the previous launch.
    2.I have no other node to modify the position of paritclestrip , only this "set position" in initialize.
     
  6. Personuo

    Personuo

    Joined:
    Mar 19, 2014
    Posts:
    129
    Is anyone else experiencing the same problem?
     
  7. Personuo

    Personuo

    Joined:
    Mar 19, 2014
    Posts:
    129
    2 weeks have passed
     
  8. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    I hate it when I don't get any answers on here xD

    okay, I have a huge problem trying to imagine what your expected outcome exactly should look like. But yes absolutely I can reproduce your result. It all looks a bit strange but the core issue mentioned in the title, no more respawn, I think I can answer why that happens.

    You start with a particle capacity of 32 and a strip capacity of 2. Hence there will be two strips at any given time, but 32 particles ... so 2 particles with strips, and 30 particles without.

    Your particles have a lifetime and die after a certain time. Your particle strips on the other hand do NOT have a lifetime at all and live forever.
    No one ever confirmed this to me but to me it seems that as long as there is a strip alive which was spawned by a particle the particle itself can not be fully killed off. A simple script that reads the aliveCount variable from the visual effect can prove this.
    upload_2022-8-4_17-49-12.png


    This locks your visual effect in a weird state. You can not spawn more particles because you have exhausted your capacity until some are killed off, but the next particle which should be killed off is connected to an immortal strip which completely blocks off killing any particles (or all those are connected to these two strips, who knows).
    But due to that you can not get more particles.
    Adding a lifetime to the strips and setting the capacity to the same makes this setup more like I would expect it in general but I am still not sure if that is what you were going for.

    upload_2022-8-4_17-46-5.png
     
    Personuo and Qriva like this.