← Back to all tools
VISUAL TOOL

Parallax Speed Calculator

Enter your camera (foreground) speed and a depth ratio for each background layer, and this calculates how fast each layer should scroll for a parallax effect.

px/s
Layer Depth Ratio Scroll Speed

What is the Parallax Speed Calculator?

For a 2D game's multi-layer scrolling background ("parallax" effect), this calculates how fast each layer should scroll. Enter a reference speed (camera or foreground) and a depth ratio for each layer, and you'll get each layer's scroll speed.

How to Use

  1. Enter a reference speed (the camera's or frontmost layer's scroll speed).
  2. Give each layer a name (optional) and a depth ratio. Closer layers use a smaller number, farther layers use a larger one.
  3. Click "+ Add Layer" to add more rows as needed.
  4. Click "Calculate" to see each layer's scroll speed.

Example

With a reference speed of 200px/s and three layers — Sky (depth ratio 4), Mountains (depth ratio 2), and Trees (depth ratio 1.2) — Sky comes out to 50.00px/s, Mountains to 100.00px/s, and Trees to 166.67px/s.

Using This in Game Development

This works with any engine — Unity, Godot, Phaser, or anything else — since all you need is each layer's scroll speed as a number. Set your foreground/gameplay layer to a depth ratio of 1 (same speed as the reference) and the sky to something like 4–8 for a natural sense of depth.

Notes

The formula is: scroll speed = reference speed ÷ depth ratio. The depth ratio must be greater than 0. The actual look also depends on your background image's size and how it tiles, so fine-tune the final values in-game.

FAQ

How do I choose a depth ratio?

Set the frontmost layer (the one that scrolls at the same speed as the player) to 1, and use larger numbers (2, 4, 8, etc.) for farther layers.

Can I use this directly in Unity, Godot, or Phaser?

Yes. Use the calculated px/s (or unit/s) value directly as each layer's scroll speed.

How many layers can I add?

Up to 10 layers.

Related tools: Sprite Sheet Calculator, Unity Speed Calculator, Dungeon Generator