Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question GPUEvent only triggering one system

Discussion in 'Visual Effect Graph' started by TheNekoda, Oct 29, 2022.

  1. TheNekoda

    TheNekoda

    Joined:
    Aug 8, 2021
    Posts:
    24
    Hello! I've been trying to figure out VFX today, and I'm going through some kind of problem right now. Whenever I try to trigger thanks a particle death event, it doesn't initialize every particle, but only the one on the left. I tried changing the count in the "Trigger event on Die", but it doesn't change anything. The second system is the same as the one on the left, except I changed the velocity and the size over time. Does anyone know if I did something wrong?

    2022-10-29 18-06-31.gif 2022-10-29 18-06-31.gif
     
  2. The_Storm_Rider

    The_Storm_Rider

    Joined:
    Jan 28, 2020
    Posts:
    63
    Have you tried to simply make 2 GPU event node ?
     
  3. TheNekoda

    TheNekoda

    Joined:
    Aug 8, 2021
    Posts:
    24
    Did and it works! I was simply wondering if I messed up something, and if I could at least optimize this part of my graph.
     
  4. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    183
    So actually you should not be able to link several “InitContext” to a single GPUEvent.
    So there’s something wrong on our UX side.
    Only one of the “Systems” is gonna be spawned.
    You can however link a “Spawn” block to multiple Systems.
    So right now the easiest solution is to use two GPU Event Blocks.
    upload_2022-11-3_10-15-29.png



    If you really want to optimize your VFXGraph you can try to make the same thing with only one GPUevent that would trigger one “System” and two “OutputContext”.
    It’s not always possible to get the same, especially if you got logic in the “UpdateContext”, but if not using multiple Output is pretty powerful.

    Here an example:
    With a “trigger on Death” Block, a “GPUEvent” is created and Spawn particles in a System.
    With two “Output Context” and some changes on the color/position you can have the impression that you have more particles..
    But in reality we’re just rendering the particles twice , with variation on “Position” and “Color”.
    Unity_eD8B7MG9Z3.gif
    upload_2022-11-3_10-19-11.png

    I hope this help you.
    Have a great day.
     
  5. TheNekoda

    TheNekoda

    Joined:
    Aug 8, 2021
    Posts:
    24
    Hello! Thank you for adressing the issue. I'll need a bit of time to fully understand your reply. In the end I probably did something similar to what you had suggested, since it was the only way for me to spawn them at the same time. Thank you very much and have a good day!