Search Unity

Mesh particles not following parent system

Discussion in 'Visual Effect Graph' started by bjedlowski97, Mar 29, 2020.

  1. bjedlowski97

    bjedlowski97

    Joined:
    Feb 13, 2018
    Posts:
    46
    I am working on an effect and need some mess particles to spawn on the death of other particles. But when I use these mesh particles they don't inherit the position like when I use regular particle systems. Do i need to do something different or special for them or does it just not currently work. Also whenever i try to give them a lifetime they just stopped working any reason for that
     
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi, if you post your graph it would help to figure out what is not working. Here's an example of a default system, just added a Trigger Event on Die, which is connected to a GPUEvent which in turn spawns particles for another system. If you want for the new particles to inherit the position of the old particles, you just need to add an Inherit Source Position block to it in Initialize.
    upload_2020-6-3_19-43-52.png
     
  3. bjedlowski97

    bjedlowski97

    Joined:
    Feb 13, 2018
    Posts:
    46
    I have done that, here are the graphs. I realized I was wrong, not on death but on spawn of my meteor particles do i need the marker particles to spawn at the meteor locations at least on the x and z axis. I am unsure why it isn't working, any help would be much appreciated, cause rn all they do is sit at the spawn point of the vfx graph. I want them to be able to spawn and then follow the movement of the meteor particles, so they could show where the meteors are going to hit.
     

    Attached Files:

  4. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi, there are a few things to note here:
    • There is no on spawn trigger. You could make your own version by checking if the lifetime is around 0 and then using the Trigger Always.
    • Your GPU Event system doesn't have a lifetime. You are spawning with a Trigger Always, so I imagine within a couple of seconds it would have already maxed out its capacity and you might miss seeing the particles you are waiting for.
    • The UI for trigger events needs to be revisited (it's still an experimental block). Basically, all triggers run at the end of Update, regardless of where the block is put within the Update context.
    Similar to the built-in Particle System's sub emitters, once a child particle is born, it can only inherit the data from its parent particle in that one frame. It cannot keep a reference to it and move with it. You can try setting a very small marker lifetime and spawn many markers so it would appear that it's moving with the parent particle. A possibly better way to do this is to not use GPU Events at all, but simply connect your red Particle Mesh Output from the marker directly to your meteor system. The VFX Graph supports multiple outputs per system. This way it will follow the meteors precisely, and you can add any kind of local changes specifically to that output (add position, to offset it a bit, add rotation, size, etc.).
     
  5. bjedlowski97

    bjedlowski97

    Joined:
    Feb 13, 2018
    Posts:
    46
    ok, thank you so much, I finally got it to where I wanted
     
    VladVNeykov likes this.