So I have an existing VFX graph that works great for what I need - it is a swirling mass of smoke that is used as a type of ghost in my game; think the Lost island smoke-monster. The issue that I’m happening is that I want to have a different effect when the monster dies/is killed where 1) the particle emitter stops producing new smoke particles, and 2) the existing particles change their rendering over to a separate rendering with a different per-particle effect. The issue is that I want to keep the existing particles that are already there and change their rendering after the triggering of my “death” event, and I can’t figure out how to do that.
With a custom event I can stop the spawning of new particles easily enough, and I have triggers enabled as experimental nodes in VFX graph editor, but there aren’t (that I can find) any kind of logic control in the graph that I can use to swap to a different update/render node-set when I kick off my event. Any help would be greatly appreciated!
If you need to change only the way it’s rendered, then I guess custom shader is the most performant solution currently.
You could make custom shader with some float variable ‘X’ and use it to ‘lerp’ between effects, zero for standard and one for when it dies. Usage would be simple, you just expose property of graph and it controls this shader variable, so you would set it along with event.
Other way, but I think it might be slower (this is guess only - I didn’t check it) would be to create two particle outputs and you would set particle alive to false in one of them. Attribute changes in output blocks are temporary, so you would not kill particles in reality. You just make him “think” they are dead in one of outputs, so in result It would just render one or the other output. There was nice gif example posted by Vlad, but I can’t find it at the moment.
Anyway this all depends what exactly you need, for instance if you want to change mesh of particles, you can just expose mesh property and work is done.