Skip to main content
‹ Back to Tutorials
Intermediate Unity

Game Design Experiment - Hyper Casual Runner using Unity and Playmaker (Part 2) September 2020

Sep 9, 2020
About this tutorial

Hi I'm Jerry from Bliz Studio LLC. In Part 2 of this game design experiment, I am setting up basic platform generation for a Hyper Casual Runner game using Unity and Playmaker. 🚀 Download Trixel Rocket for free on App Store at: https://apple.co/31s4gzt ► Download Unity at https://unity.com ·····

Written Guide

Part 2 of the hyper-casual runner experiment replaces last episode's faked movement (four looping cubes) with real level generation: platform prefabs stored in an array, spawned on a timer, moved toward the camera, and destroyed off-screen. Here's the complete pipeline as built in the video.

Step 1 — Build the platform prefab with ProBuilder

Create an empty GameObject named Platform as the container, then use ProBuilder (install it from Window > Package Manager if needed) to add a cylinder inside it: radius 2 (so the platform is 4 units wide), 20 sides so it reads as round rather than the default faceted 8, height 3, rotated 90 degrees on the X axis so it lies on its side. The rounded-world idea is that obstacles stick out of the cylinder and the player rotates the whole world to dodge them. Drag the container into a Prefabs folder — the hierarchy copy turns blue, and you can now stamp out as many instances as you want.

Step 2 — Make platforms move with one shared speed

On the prefab itself, add an FSM named Move Platform with a Translate action on the Z axis, per second and every frame. Instead of hardcoding the speed, bind it to a new global float called platform speed, set to -1 (positive 1 moves the platform away from the camera — an easy sign flip to catch). Using a global means every platform in the scene reads one number, so speeding the game up over time is a single-value change rather than a hunt through every instance.

Step 3 — Spawn from an array

Create an empty Platform Generator with an FSM named Create Platform. Add an array variable named platforms (array type: Game Object) and drop the prefab in as element zero. The spawn state chains three actions: Array Get Random pulls a prefab into a variable, Create Game Object instantiates it at a Spawn Point (an empty inside the platform container, pushed back to about -6 in Z and offset 2 units to center the cylinder), and Set Parent puts the new instance inside the rotating container. One gotcha from the video: parent the variable that Create Game Object stores — the actual spawned instance — not the prefab reference you pulled from the array. A Wait state of 3 seconds (cylinder length 3, speed 1 unit per second, so platforms spawn back-to-back) loops to spawn the next one.

Step 4 — Destroy platforms off-screen

Endless spawning needs cleanup. Place a cube behind the camera, tag it destroyer, and slide it back (about -4) until platforms are fully off-screen when they reach it. On the platform prefab, add a Trigger Event: on trigger enter with the destroyer tag, send a destroy self event into a state holding the Destroy Self action (leave detach children off so future child obstacles die with the platform). The platform also needs a Rigidbody with gravity disabled and a Box Collider sized to the object — and crucially, Is Trigger checked, or the overlap never registers.

Step 5 — Add variety

Duplicate the prefab into Platform 1, 2, and 3, each with ProBuilder prism spikes (set as triggers) rotated and positioned differently. Grow the array size to 3, drag the new prefabs into the slots, and Array Get Random handles the rest — every spawn pulls a random layout. Next episode: a Mixamo character joins the run.

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 →