Prevent vfx graph's flipbook looping

hey is there a way to set flipbook to stop when it finish and not start again ?

Good morning, and the answer to your question is YES.

So, I’m guessing that you might be using the Flipbook Player Block to animate your texture. The animation comes from the fact that this block increments the value of the texIndex Attribute. Before Unity 6, the only available to this FlipBook Player block was Framerate. This allows you to specify the Frame rate for the flipbook.

Now to be sure that a Flipbook does not loop priors to Unity 6 there are a couple of solutions:

  • You could clamp the texIndex value in the Output context between your Start frame index and the Last Frame Index.
    9917736--1433925--upload_2024-7-1_13-36-59.png

  • You can select your texture in your project and, in the inspector change the Wrap mode to Clamp.

  • 9917736--1433928--upload_2024-7-1_13-51-29.png*
    While both solutions work, depending on the FlipBook Player framerate and your particle’s Lifetime, you could end up with still-alive particles stuck on their last frame index.

Priors to Unity 6, a more adequate solution could be to manually animate the texIndex Attribute to ensure that you only make one animation cycle. For this, you can drive the texIndex value by lerping between the start frame index and the last frame index with the Age over Lifetime for example.

A good thing with this solution you can also sample a curve to control the animation profile of your animation.
9917736--1433937--upload_2024-7-1_14-0-2.png

9917736--1433940--upload_2024-7-1_14-5-26.png

Now, if you’re already using or testing Unity 6 preview, the Flipbook Player Block has been greatly improved.

  • First, a new mode has been introduced called “Cycle”. So for what you’re trying to achieve you’ll only need to set the mode to Cycle and set the Cycle to 1 if you only want 1 cycle.

This update also adds some new options like randomizing the Start Frames, specifying a specific Row/columns or directly specifying the Start&End Frames to name a few.

  • 9917736--1433961--upload_2024-7-1_14-11-2.png*

I hope that this will help you.

Have a great day

this will help me thanks