Unity 3D Playmaker - Creating Flappy Birds - Set Up Pipes
In this mini Unity 3D Playmaker - Creating Flappy Birds - Creating Pipes tutorial, we will be setting up the Pipes. In this second part of the tutorial, we will create the Pipes, animate them across the screen, as well as generating the pipes on screen. Unity package of the files for you to start
This entry in the Flappy Bird series builds the pipe system: a prefab pair of pipes with a scoring gap, an FSM that slides them across the screen and deletes them at the far edge, and a spawner that drops a new set at a random height every couple of seconds. It's the obstacle engine the rest of the game hangs on.
Set the scene and build the pipe
Switch the main camera's background from Skybox to a solid color for the flat Flappy Bird look. Create an empty named Pipes at 0,0,0 and drag in your pipe art, resetting its scale to 1,1,1. Add a Box Collider (rectangular suits the pipe better than a capsule), shrink it slightly inside the art to be forgiving, and enable Is Trigger. Create two tags — pipe and pipe score — and tag this pipe as pipe.
Make the gap and its score trigger
Duplicate the pipe and rotate it -180 on X to flip it for the top, then separate the two enough for the bird to pass. Add a cube between them, scale it to fill the gap top to bottom, enable Is Trigger on its Box Collider, tag it pipe score, and uncheck its Mesh Renderer so only the invisible trigger remains. This is what later detects a successful pass for scoring.
Move and self-destruct the pipes
Add an FSM with a Move Pipes state using Translate on the X axis. Instead of hardcoding the speed, leave Use Variable checked and create a global variable pipe speed (set to -1) so it's easy to tune everywhere at once. Add Get Position storing the X into an x pos variable every frame, then a Float Compare against -3: when x pos is less than or equal to -3, fire a destroy pipes event into a Destroy Pipes state that runs Destroy Self. Finally drag the Pipes object into a prefabs folder to make it a prefab and delete it from the scene.
Build the spawner
Create an empty Pipe Spawner positioned at X = 3 (just off-screen) with Y and Z at 0 — it serves as both the spawn position and a container. Keeping spawn logic on a fixed off-screen anchor means every pipe starts at a consistent point before sliding left.
Spawn at random heights on a timer
On the game manager, add a pipe spawner FSM. In its first state use Float Random (around -0.8 to 0.8) stored in a pipes position variable, Set Position on the spawner's Y from that value (once, not every frame), then Create Object spawning the Pipes prefab at the spawner. Finish into a Wait state of 2 seconds, then loop back to spawn again. The result is an endless stream of pipes at varying gap heights, with timing and range easy to adjust later.





