Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Output Event crashes the graph

Discussion in 'Visual Effect Graph' started by steffanPL, Nov 8, 2021.

  1. steffanPL

    steffanPL

    Joined:
    Oct 9, 2014
    Posts:
    40
    Hey,
    I wanted to add audio output event when my particles die.
    So I've made a thing from attachments:

    but unfortunately, I am getting compilation errors for this graph:


    What's the correct way of handling Output Events?
    What am I doing wrong?

    I am on Unity 2021.2.0b14, and v12 of Visual Graph.
    Thanks!

    Edit:
    Same issue on Unity 2022 Alpha:
     
    Last edited: Nov 8, 2021
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,112
    I think this is not possible, GPU and CPU events can't be mixed. Also I think Spawn context shouldn't be connected to GPU event, even though it is possible, check docs (table below) https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@10.2/manual/Contexts.html
    This table should be improved - it's hard to deduct that GPUSpawnEvent is not allowed there while editor allows it.

    Additional source about CPU event: https://forum.unity.com/threads/is-it-possible-to-trigger-c-events-from-graph.986634/#post-6410532
     
  3. steffanPL

    steffanPL

    Joined:
    Oct 9, 2014
    Posts:
    40
    @Qriva thanks for your answear- it makes sense.
    So is there any other way/hack to invoke C# event when a particle dies, or its collision is triggered?
    I wanted to play some audio when it happens.
     
  4. murilloetermax

    murilloetermax

    Joined:
    Feb 24, 2020
    Posts:
    1
    @steffanPL did you managed to get this working? If yes, can you share your solution, please?