---
title: "Randomize a flipbook start frame in Godot 4"
description: "Set Animation Offset Min 0 and Max 1 in the ParticleProcessMaterial and turn on Loop in Particles Anim, so each particle starts on its own frame."
canonical: https://appliedmanifold.com/guides/godot-random-flipbook-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 // GODOT 4

# How to randomize the starting frame of a flipbook in Godot 4

Set Animation Offset Min to 0 and Offset Max to 1 in your ParticleProcessMaterial, and each particle starts on a random cell of the sheet. Turn on Loop under the material's Particles Anim too, so a particle that starts late wraps back to frame one instead of freezing on the last frame. Use this on looping smoke and fire.

[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.

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

01 // HOW TO

## Give each particle its own first frame

1.  Select the `GPUParticles3D` and open its `ParticleProcessMaterial` > Animation.
2.  Set Offset Min to 0 and Offset Max to 1. The offset is a fraction of the sheet, so 0.5 starts on the middle frame.
3.  Open the draw pass `StandardMaterial3D` and turn on Billboard > Particles Anim > Loop.
4.  Set Speed Min and Speed Max a little apart, such as 0.9 and 1.1, so particles also drift out of step over time.
5.  Play the scene. Neighboring puffs should now show different shapes on the same frame.

02 // WATCH FOR

## Why particles freeze without Loop

The frame a particle shows is its offset plus its progress through life. With Loop off that number stops at the last frame, so a particle that started at 0.6 reaches the end with 40% of its life left and holds a still image for the rest.

One-shots are the exception. An explosion sheet has to start at the flash, so a random offset makes some particles skip it. Keep Offset Max near 0.05 for bursts and vary rotation and size instead.

03 // WITH SPATIAL COMPILER

## Offset the clock on a wired scene

The scene your agent writes takes its clip time in seconds, so you set the start yourself.

smoke\_offset.gd

```
extends Node3D

const LOOP_S := 4.0  # the smoke plume loop length

@onready var smoke = $SmokePlume  # the scene wire wrote, instanced here
var t := 0.0

func _ready() -> void:
	smoke.autoplay = false
	t = randf() * LOOP_S  # start anywhere in the loop

func _process(delta: float) -> void:
	t += delta
	smoke.time_s = fposmod(t, LOOP_S)
```

Each copy of the smoke now sits at its own point in the loop, so a row of chimneys no longer puffs in unison.

04 // REAL OUTPUT

## Loops that suit a random start

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

05 // RELATED

## Related pages

-   [Godot smoke plume Godot 4A smoke plume that leans with the wind and loops every 4 seconds, dropped into a Godot 4 scene by your agent.](https://appliedmanifold.com/effects/godot-smoke-plume/)
-   [Flipbook textureA flipbook texture packs an animation's frames into one grid image that your engine plays cell by cell on a quad.](https://appliedmanifold.com/learn/flipbook-texture/)
-   [Varied explosions Godot 4Keep repeated explosions in Godot 4 from looking identical with random variants, small scale and timing changes and mixed layers.](https://appliedmanifold.com/guides/godot-varied-explosions/)
-   [Random start frame UnityGive each Unity flipbook particle a random start frame so many copies of one looping fire or smoke stop moving in sync.](https://appliedmanifold.com/guides/unity-random-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/)
-   [Random start frame three.jsPlay one looping sprite sheet on many three.js sprites out of step with a random frame offset per sprite.](https://appliedmanifold.com/guides/threejs-random-start-frame/)
-   [Bake and wireCall `bake` with a `.pyro.toml` spec and an output folder, then `wire` to write a Godot 4 scene with the six-way shader. `check`, `schema` and `sweep` support the loop.](https://appliedmanifold.com/docs/pyrofx/bake-and-wire/)

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

[← Loop a fire sheet](https://appliedmanifold.com/guides/godot-loop-fire-sprite-sheet/)[Smoke and scene lighting →](https://appliedmanifold.com/guides/godot-smoke-scene-lighting/)

06 // FAQ

## Random start frame questions

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

**README.GODOT\_RANDOM\_FLIPBOOK\_START\_FRAME**

### How do I randomize the starting frame of a smoke flipbook in Godot?

Set Animation Offset Max to 1 in the process material and turn on Particles Anim Loop in the draw material for smooth wrapping.

### How do I animate different smoke frames for each particle?

Give particles different animation offsets and slightly varied speeds so each one starts on a different cell and stays out of step.

### How do I make every explosion particle use a different random frame?

Keep Offset Max near 0.05 so every particle still shows the opening flash, then vary angle and scale for visual variety.

### Can particles share one flipbook but start on different frames?

Yes, every particle in one emitter reads the same sheet while the Animation Offset range picks a different starting cell for each.

## 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) [Bake and wire →](https://appliedmanifold.com/docs/pyrofx/bake-and-wire/)

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