Skip to main content
‹ Back to Tutorials
Beginner Unity

Unity + Playmaker - EASY Pinball Game - Bumpers and Restart

Mar 10, 2022
About this tutorial

In this mini Unity + Playmaker EASY Pinball Game tutorial series, I am going to show setting up the bumpers with colliders and physics materials as well as adding a Start button and Restart. ► Download the board graphics here: https://bit.ly/3BWk0v2 (to Join my discord server add a comment and I'l

Written Guide

This entry takes a static pinball table and makes it come alive: bumpers that fling the ball around, and a clean restart loop driven by a Start button. Everything is built in 2D with colliders, Physics Material 2D assets, and a small Playmaker FSM, and because the bumpers are prefabs, you tune one and push the change to every copy at once.

Give the bumpers colliders and bounce

A ball only reacts to objects that have a collider, so select your short bumper prefab and add a Polygon Collider 2D — it suits the irregular shape better than a circle or box. Use Edit Collider to nudge the green outline close to the art; it doesn't have to be perfect. A collider alone makes the ball stop, not bounce, so create a Physics Material 2D (be sure to use the 2D version, not the 3D one) named bumper bounce and drop it into the collider's Material slot. Set Friction to about 0.2 so it behaves like rubber, and Bounciness to 1 as a starting point.

Tune the feel, then push it to every bumper

Drag the bumper into the ball's path, press Play, and launch the ball to judge whether the bounce feels right — these values are meant to be played with. Once you're happy, you don't want to repeat the work on every bumper. Open the prefab Overrides dropdown on that instance and choose Apply All, which sends your collider and material changes to every short-bumper instance in the scene at once.

Build the bouncier triangle bumpers

The triangle bumpers get two colliders so different parts feel different. Add a Polygon Collider 2D over the whole triangle and assign a bumper triangle bounce material that matches the short bumpers. Then add a smaller Edge Collider across just the center face and assign a second material, bumper triangle bounce 2, with Bounciness set high (around 2–3) so the middle really kicks the ball. Place the edge collider just in front of the polygon so the hot zone sits where you want it, then Apply All to update both triangle prefabs.

Add hard, non-bouncy surfaces

Curved bumpers and the short filler pieces should feel solid rather than springy, so give each a Polygon Collider 2D and skip the physics material entirely — with no material the ball simply deflects. Apply the override to the prefab so all instances pick up the collider. Duplicate and reposition these hard pieces, angling a few inward so they catch the ball and feed it back into play instead of letting it drain.

Detect the ball draining and destroy it

In the Game Start FSM, after the ball launches, transition to a Detect Ball End state. Use a Trigger Event on On Trigger Enter that watches for the Pinball Ball tag hitting the Ball End trigger at the bottom of the table. Because balls are spawned, you don't reference a specific object — the tag is enough. On that event, move to a Destroy Ball state and use Destroy Object on the detected ball (not Destroy Self).

Wire up a Start Ball button

Replace the old click-to-launch with a real button. Add a TextMesh Pro button to the in-game canvas, swap its sprite for a circular pinball part, size it around 200x200, label it START BALL in the project font, and color it to match the pink UI. In Game Start, delete Get Mouse Button Down and instead listen for the button's UI On Click event to fire the launch. Deactivate the button as the ball launches, then in Destroy Ball reactivate it and transition back to Wait For Input — giving you a repeatable play-and-restart loop.

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 →