Skip to main content
‹ Back to Tutorials
Beginner Unity

Unity 3D Playmaker - Creating Flappy Birds - For Beginners

Dec 16, 2021
About this tutorial

In this mini Unity 3D Playmaker - Creating Flappy Birds - For Beginners tutorial series, we will be recreating the Flappy Birds game in 3D. In this first part, we will create the bird flapping as well adding input for both mobile and desktop. Unity package of the files for you to start your projec

Written Guide

First entry in a beginner mini-series recreating Flappy Bird in 3D. This part builds the bird itself: physics that pull it down, a flap that pushes it up, wings that animate on each press, and a particle burst for feedback — all driven by one small Playmaker FSM listening for a key or a touch.

Prepare the bird object

The bird is an empty game object containing the body (wings included) and a particle effect with Play On Awake unchecked — it should fire per flap, not on load. Its animator has two states: wings up as the default, and wings down. The wings down state transitions automatically back to wings up with exit time enabled and a short transition, no condition needed — flap down, snap back up, every time. On the physics side, add a Rigidbody (this is 3D, so not Rigidbody 2D) with gravity checked so the bird falls, and a mass around 0.5 or 0.6 — a number worth playing with. Add a Sphere Collider and edit it down to hug just the main body; including the wings makes the hit zone too generous.

Listen for input

Create an empty called game manager and add an FSM labeled player flap. Name the first state listen and give it a Get Key Down action on the space key. When it fires, send a new flap event, add the transition, and Ctrl-drag (Cmd on Mac) to a new state called flap.

Do three things per flap

The flap state does exactly three jobs. First, Add Force: the FSM lives on the game manager, so switch to specific game object and drag in the bird, then apply 5 on the Y axis with force mode set to impulse — an instant burst rather than sustained thrust, which is what gives Flappy Bird its pop. Second, Particle System Play, again pointed specifically at the flap particles object. Third, Animator Play on the bird: copy the exact wings down state name from the animation asset and paste it into the state name field. Finish with a finished transition back to listen.

Add mobile touch support

Since this could ship as a mobile game, add a Touch Event action alongside Get Key Down in the listen state, with the touch phase set to began, sending the same flap event. Two inputs, one code path. Press play: gravity drags the bird down, each space press bursts it upward, wings snap down and animate back up, and particles pop on every flap. Next tutorial: the pipes.

Unity tools by Bliz Studio
Built for our own games — now on the Asset Store

Multi Tag — unlimited hierarchical tags for any GameObject. Hierarchy Pro — style your whole hierarchy with rules. Made by a Unity dev, for Unity devs.

Explore our Unity assets →