Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

GPU Event :Trigger On Die work only if there is a lifetime

Discussion in 'Visual Effect Graph' started by Levrden, Feb 25, 2020.

  1. Levrden

    Levrden

    Joined:
    Jan 26, 2016
    Posts:
    16
    Hello

    I want to make a particle appear when a sphere collides to it. So i have a Kill node in the update with my sphere. If they don't collide with the sphere, my particles don't have a lifetime.
    But when i add the trigger event on die, the new particles are always there, even if they don't die. Everything works properly when i set a lifetime on the particles, which i don't.

    For now i have set a start lifetime to my particles and i add to them lifetime with total time... it is not perfect but i does the job for now.

    I wonder if the probleme may come from the Computed Source code of the trigger event on die node :
    eventCount = (age + deltaTime > lifetime || !alive) ? count : 0;

    But i couldn't achieved to change it, is there any way ?

    Thanks
     
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @Levrden

    To confirm, you want to spawn particles via a On Die trigger?
    If so, you can still set lifetime in Initialize, but disable particle aging in the inspector by selecting Update and disabling Age Particles:
    upload_2020-2-27_18-42-15.png

    This way you can still kill particles on collision, but don't have to manually add to their life to force them to stay alive.
    Does this suit your use case?
     
    PixCaffeinedBear likes this.
  3. Levrden

    Levrden

    Joined:
    Jan 26, 2016
    Posts:
    16
    Okay Thank you !!
    Looks like it suits=)
     
    VladVNeykov likes this.