Unity Playmaker Tutorial - 2d Platformer Parallax Background
In this Unity 2D Playmaker Simple Parallax Background tutorial, I'll take a look at setting up a Unity 2D Playmaker parallax. Parallax is setting up movement that will give you the illusion of 3D depth movement in a 2D game. I'll show how to use the Float Operator action to handle the math of usin
This tutorial adds parallax scrolling to the 2D zombie platformer — background layers that slide at different fractions of the player's speed to fake depth. The approach is deliberately simple: one Playmaker FSM does a speed calculation per layer, then translates each layer every frame. No camera scripts, no scrolling shaders.
Step 1 — Understand the layer stack
The scene is organized into five layers: the sky background and the moon, which stay static; a far background of distant trees; a mid background of closer trees; and the ground the zombie runs on. Duplicate the tree and ground layers sideways so there's enough art for a full level before wiring anything up. The zombie's movement speed is already stored in a global float called player speed — that global is what makes the whole parallax possible from a separate FSM.
Step 2 — Create the parallax FSM and the first calculation
Under the game manager, create an empty game object named Parallax and give it an FSM of the same name with a single Parallax state. Add a Float Operator action: take player speed, multiply it by 0.9, and store the result in a new float called far background, every frame. The logic: layers that are farther away should move at a smaller fraction of the player's speed, and layers closer to the camera at a larger one — that speed difference is the entire illusion.
Step 3 — Translate the far background
Below the calculation (order matters — calculate first, then move), add a Translate Position 2D targeting the far-background object, updating its X with the far background variable, set to per second and every frame. Playmaker will complain that translate needs a Rigidbody 2D, so add one — and immediately set its gravity scale to 0, or your scenery will fall out of the world.
Step 4 — Pin the static layers and the camera
The sky, the moon, and the camera should hold their position relative to the player, so give each a Translate Position 2D driven by the full player speed value — moving at exactly the player's pace means they appear motionless. There are fancier ways to handle a camera, but this is the simplest that works here. Each of these objects also needs a Rigidbody 2D with gravity scale zeroed.
Step 5 — Repeat for mid ground and ground
Copy the calculation-plus-translate pair and paste it twice. For the mid background, multiply player speed by 0.7 into a new mid background variable and drive the parallax-mid object with it. For the ground layer, use 0.5 into a ground variable. Same drill each time: Rigidbody 2D, gravity scale 0, X axis fed by the matching variable. Test it: the foreground slides fastest, the mid trees lag behind, the far trees barely crawl, and the sky and moon ride along with the character. Three multipliers — 0.9, 0.7, 0.5 — and the flat scene suddenly has depth.





