Some help with Vfx Graph, managing alive between trail and particle

Hi everyone,

I have been trying for a while to do something with vfx graph which I though would not be that difficult so I believe I am utterly not seeing an obvious solution here and very much like to ask for some help.

I want to spawn a particle, have it follow the emitter transform / a specific transform position.
From the particle’s position create a trail / ribbon.
Have the particle die in order to stop the trail from growing further (preferably through an event, otherwise a bool property works too I already figured out)
Then NOT have the trail age and destroy from oldest vertex but instead use a dissolve shader to remove the entire trail at once and then after that is done kill the trail particles.

This sounds like I want to to use the main particles alive state to determine if I should subtract delta time from a per strip attribute (which I can use as alpha in the shader).
But no method I tried so far gives me a per strip attribute NOR getting alive from the main particle works at all.

Help is much appreciated, thanks so much in advance of any input

Hi!

I’m not sure I got it right, but I’ll send something that might help? I’m assuming you want one single trail, which makes it easy to start at least.

This might not be the best way to do this, but it’s late and I’m wondering if this is even what you wanted to achieve. I also don’t know how much experience you have with VFX Graph so I’ll just explain everything.

I’ve added 3 parameters, one to control the trail’s dissolve amount, and two to control the alive state of the head and trail. This can be done in lots of other ways (like killing the trail when dissolve eaches 1 etcetc).

image

So you have your main ‘head’ particle, this follows the gameobject with the Visual Effect component on it (that’s why it’s using the Local space).
Lifetime isn’t set, meaning that particle doesn’t die unless we kill it.
Alive state is set on update because we want to continuously update that state in case it changes. You’d want to set it to false to stop creating the trail.
That particle triggers a GPU event over time to spawn the trail.

Trail is using the World space, because I’m moving the gameobject with the Visual Effect component around and want the trail to stay in place.
Trails position is set to the source’s (head) position.

Alive state same as head, updated continuously, you’d set that to false to kill the trail after it was dissolved.
Lifetime isn’t set, meaning that particle doesn’t die unless we kill it.
The output uses a custom shader graph, it’s just a simple step to have some kind of dissolve to show.

I’m killing the main head first, it doesn’t spawn the trail, then dissolve the trail, then kill trail

vfxgraphhelp

2 Likes