---
title: "Should the first and last frames of a loop match"
description: "No. The last frame should lead into the first like any other step. A copy of the first frame at the end shows twice and makes the loop hitch."
canonical: https://appliedmanifold.com/guides/loop-first-last-frame/
site: "Applied Manifold: The spatial compute cloud for 3D reality"
---

1.  [Home](https://appliedmanifold.com/)
2.  [Guides](https://appliedmanifold.com/guides/)
3.  First and last loop frames

GUIDE // ANY ENGINE

# Should the first and last frames of a loop match

No. The last frame should be the step just before the first, so the wrap plays like any other step. If the two are identical, that pose shows twice and you see the loop hitch. Make the end flow into the start by crossfading the final frames into the opening ones, after the effect has settled into its steady state.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [See the examples →](https://appliedmanifold.com/docs/pyrofx/examples/)

-   Godot 4 Available
-   Unity Manual setup
-   Unreal Engine Manual setup
-   Roblox Studio Manual setup
-   three.js Available

A draft compile is from $0.05, and new accounts start with $5 of usage.

**FIREFINAL**

![First frame of the fire bake](/bakes/fire/poster.webp)

Fire, 4.1 x 7.0 m, compiled with Spatial Compiler. [Spec →](https://appliedmanifold.com/docs/pyrofx/examples/#ex-fire)

01 // WHY

## Why a matching frame hitches

A loop of 64 frames plays frame 63, then frame 0. If frame 63 is a copy of frame 0, the viewer sees the same image for two steps in a row, a held frame once per cycle. At 32 frames per second that pause lasts 1/32 of a second, enough to catch the eye on fire.

A loop that never matches at all jumps instead. A clean loop sits between the two, with frame 63 differing from frame 0 by the same small amount as any two neighbors.

02 // HOW TO

## Build a loop that wraps

1.  Run the simulation or animation until the effect has settled, so the fire is burning steadily, and start recording from there.
2.  Record more frames than the loop needs, for example 72 for a 64-frame loop.
3.  Crossfade the 8 extra frames over the first 8 frames of the loop: frame 0 takes most of extra frame 0 and a little of its own, frame 7 takes nearly all of its own.
4.  Drop the extra frames. Frame 63 now flows into frame 0 because frame 0 started as the frame that followed 63.
5.  Play the loop for a minute at the real rate and watch the wrap, not only the first cycle.

03 // WITH SPATIAL COMPILER

## Let the compile blend the loop

**SMOKE\_PLUMEFINAL**

![First frame of the smoke\_plume bake](/bakes/smoke_plume/poster.webp)

Smoke plume, 7.0 x 10.8 m, compiled with Spatial Compiler. [Spec →](https://appliedmanifold.com/docs/pyrofx/examples/#ex-smoke_plume)

Ask your agent for a looping effect and the compile runs a warm-up first (`warmup_s`), then blends the last frames into the first (`loop_blend_frames`, 8 by default and 12 in the shipped loops). The report your agent reads measures the seam and names the setting to change if it shows. The example fire loops 2 seconds and the smoke plume 4 seconds.

04 // RELATED

## Related pages

-   [Loop a fire sheet Godot 4Find why a fire loop pops in Godot 4 and fix it in the sheet, the AnimatedSprite3D or the GPUParticles3D emitter settings.](https://appliedmanifold.com/guides/godot-loop-fire-sprite-sheet/)
-   [Loop a flipbook in Unity UnityKeep a fire or smoke flipbook looping in a Unity Particle System by matching particle lifetime to whole cycles of the clip.](https://appliedmanifold.com/guides/unity-loop-flipbook/)
-   [Loop a flipbook in Niagara Unreal EngineLoop a fire or smoke flipbook without end in Niagara by looping the emitter at the clip length and bursting one particle per loop.](https://appliedmanifold.com/guides/unreal-loop-flipbook/)
-   [Loop a sprite animation three.jsLoop a fire or smoke sprite sheet in three.js from elapsed time, so it plays at the same speed on every screen.](https://appliedmanifold.com/guides/threejs-loop-sprite-animation/)
-   [Loop vs one-shotLooping effects repeat until stopped and one-shot effects play once and fade out, and each needs its own frames and settings.](https://appliedmanifold.com/learn/loop-vs-one-shot/)
-   [Steady fire sprite sheetA steady fire about 1.5 m across as a 2 second looping sprite sheet for wrecks and campfires, sized to your scene and lit with a flicker light.](https://appliedmanifold.com/effects/steady-fire-sprite-sheet/)
-   [OutputsWith the default export, each view writes four sheets, `<view>_pos.png`, `_neg.png`, `_colour.png` and `_aux.png`, plus `layout.json`, two still previews, the animated `preview_anim.png` and `bake_report.json`. Sheets are 8 x 8 tiles of 256 px by default.](https://appliedmanifold.com/docs/pyrofx/outputs/)

[All pages in Guides →](https://appliedmanifold.com/guides/)

[← Flipbook frame rate](https://appliedmanifold.com/guides/flipbook-frame-rate/)[Sprite sheet seams →](https://appliedmanifold.com/guides/sprite-sheet-seams/)

05 // FAQ

## Loop frame questions

[All questions →](https://appliedmanifold.com/faq/)

**README.LOOP\_FIRST\_LAST\_FRAME**

### How do I loop a fire or smoke flipbook continuously in Unity?

Turn on Looping in the Main module and set Texture Sheet Animation to play the whole sheet once per cycle. The sheet must wrap cleanly.

### How do I loop a fire or smoke flipbook in Niagara?

Set the Sub UV Animation module to loop and keep the emitter looping. The wrap is only as clean as the last frame.

### How do I make a Roblox fire flipbook loop continuously?

Set FlipbookMode to Loop and FlipbookFramerate to the sheet rate, up to 30. FlipbookStartRandom hides the wrap further.

### How do I loop a fire or smoke sprite sheet animation in three.js?

Take the frame index modulo the frame count, such as frame modulo 64, so frame 63 wraps to frame 0.

## Compile your first effect

You pay per compile and see the price before it runs. New accounts start with $5 of usage.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [Outputs →](https://appliedmanifold.com/docs/pyrofx/outputs/)

[All effects, guides and explainers →](https://appliedmanifold.com/effects/)
