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.

  • 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
Smoke plume, 7.0 x 10.8 m, compiled with Spatial Compiler. Spec →

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
Fire, 4.1 x 7.0 m, compiled with Spatial Compiler. Spec →

06 // FAQ

Random start frame questions

All questions →

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.

All effects, guides and explainers →