Is there a way to trigger an event from within a shader graph using a boolean?

Hey!
Is there a way to trigger an event from within a shader graph using a boolean?

Use case: I would like an effect to automatically stop after a certain duration. I can achieve this with script but I was thinking there might be simpler ways to do this? I could for instance compare the total time with a threshold and trigger an event based on this comparison but booleans cannot be connected to output event (or am I missing something?). See below:

Further, I thought being able to trigger events using internal booleans could be very handy and generalize to other things like being to trigger events when reaching a certain size or whatever. What do you think?

Many thanks in advance!

Morning, and sorry for the late answer.
Could you try to a bit more precise about what you try to achieve? Your post mention Event and ShaderGraph, but it also seems that you only want a VFX to stop after a certain amount of time.

If so, it’s only a matter of setting the Spawn System Loop Count Settings and Loop Duration.
These settings can be found in the Inspector when you select a Spawn Context.

9487333--1334995--upload_2023-11-22_15-35-35.png
In this example, the VFX will spawn 500 particles per seconds for 1 loop of 10 seconds and will stop after that.

Please don’t hesitate to elaborate on what you’re trying to achieve so that I can better help you.

:slight_smile: