---
title: "Randomize the start frame of Niagara flipbook particles"
description: "Randomize the start frame of Niagara flipbook particles: store a random offset at spawn, then set Sub Image Index from age plus offset, wrapped at 64."
canonical: https://appliedmanifold.com/guides/unreal-random-start-frame/
site: "Applied Manifold: The spatial compute cloud for 3D reality"
---

1.  [Home](https://appliedmanifold.com/)
2.  [Guides](https://appliedmanifold.com/guides/)
3.  Random start frame

GUIDE // UNREAL ENGINE

# How to randomize the start frame of flipbook particles in Niagara

Give each of your particles a random frame offset when it spawns, then set its Sub Image Index from its age times the frame rate plus that offset, wrapped to the frame count. Every particle sharing the looping flipbook then plays at the same speed but out of step with the others. Keep one-shot explosions starting on frame 0.

[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 // HOW TO

## Spread a row of fires out of step

1.  Give the emitter a Box Location shape the length of the row, and spawn the fires with a burst, for example Spawn Count 5.
2.  In Particle Spawn, click the plus button, choose Set new or existing parameter directly, and add a float named `Particles.FrameOffset`. Set its value with the Random Range Float dynamic input, from 0 to 64.
3.  In Particle Update, disable the Sub UV Animation module so it does not overwrite your frame.
4.  Add another parameter set for `Particles.SubImageIndex`, choose New Expression on its value and enter `fmod(Particles.Age * 32 + Particles.FrameOffset, 64)`. The 32 is the 2 s fire's rate, 64 frames in 2 s.
5.  Keep Sub Image Size at 8 x 8 on the Sprite Renderer, and turn on Sub UV Blending Enabled if the fraction should blend frames.

02 // REAL OUTPUT

## Slower loops need a slower rate

For the 4 s smoke plume, the expression uses 16 instead of 32, since its 64 frames span twice the time.

**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)

03 // WHY THIS WAY

## Why an offset that wraps

Raising only the start frame of a first-to-last lookup makes that particle cover fewer frames in the same lifetime, so it plays faster than its neighbors. A wrapped offset keeps every particle on the full 64 frames at the clip's real speed, each starting at a different point.

A looping sheet has no special first frame, so any offset looks natural. On a one-shot explosion the same offset would skip the flash, so give explosions variety with new seeds instead of random frames.

04 // RELATED

## Related pages

-   [Random start frame Godot 4Use Animation Offset and Particles Anim Loop in Godot 4 so each particle starts its flipbook on a different frame.](https://appliedmanifold.com/guides/godot-random-flipbook-start-frame/)
-   [Random start frame Roblox StudioStart each Roblox flipbook particle on a random frame with FlipbookStartRandom, and vary one-shot explosions with separate emitters.](https://appliedmanifold.com/guides/roblox-random-start-frame/)
-   [Niagara Sub UV setup Unreal EngineSet Sub Image Size, a Particle SubUV material and the Sub UV Animation module so a Niagara sprite plays an 8 x 8 flipbook.](https://appliedmanifold.com/guides/unreal-niagara-subuv/)
-   [Unreal steady fire Unreal EngineA steady fire about 1.5 m across that loops every 2 seconds, played in Unreal Engine by hand today.](https://appliedmanifold.com/effects/unreal-steady-fire/)
-   [Unreal Engine VFX Unreal EngineFire, smoke, explosion and dust effects in Unreal Engine: sprite sheets you set up by hand.](https://appliedmanifold.com/effects/unreal-vfx/)
-   [Particle systemA particle system spawns and updates many small sprites or meshes from an emitter to make sparks, smoke, rain and fire.](https://appliedmanifold.com/learn/particle-system/)
-   [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/)

[← Play an explosion once](https://appliedmanifold.com/guides/unreal-explosion-play-once/)[Sub UV blending →](https://appliedmanifold.com/guides/unreal-subuv-blending/)

05 // FAQ

## Niagara random start frame questions

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

**README.UNREAL\_RANDOM\_START\_FRAME**

### How do I randomize the starting frame for Niagara smoke particles?

Set the Sub UV Animation module to start on a random frame or switch its mode to Random across the 64 frames.

### How do I randomize the starting frame for Niagara flipbook particles?

Store a random offset per particle at spawn and set Particles.SubImageIndex from age times frame rate plus that offset, wrapped with fmod.

### How do I use a sprite sheet with Niagara particles?

Set the Sprite Renderer Sub Image Size to the grid and sample the texture with a Particle SubUV node, which reads the frame from Particles.SubImageIndex.

### Can particle systems use multiple effects from one atlas?

Yes, each emitter points to its own cell range using Start Frame in Unity, Animation Offset in Godot or Niagara Sub UV Animation.

## 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/)
