Can you create a visual effects graph that plays once?

Hey. In our game we recently changed over to the HDRP. And we quickly figured out all our particles stopped rendering. And we thought it would be great to swap it over to Visual Effects anyways.

But now all our particles is looping. How do we make “play once” effects?
For example, an explosion effect.

What I ended up doing for now, was to create a PlayForDuration script. Which essentially just starts a coroutine for a specified amount of time and then stops the visual effect again. Not a great solution. But it does the trick for now I guess.
Unity Developers, if you read this… Please add a PlayOnce() method as well as a IsPlaying boolean to the VisualEffects at some point. :slight_smile:

1 Like

I was thinking Instantiate the VFX but it depends how many times you would call it and how would that impact performance.

I think take a look at the samples in the FPS project. You probably will find what you’re looking for.

(Disclaimer: I know nothing about VFX, so I don’t know what I’m talking about)

Click on spawn node and set loop duration and loop count to constant in inspector tab

4 Likes