Hover racer
For creatorsAdd-on 2.2.2+
In this tutorial you build a hover race: six craft, a 318 m circuit with a dogleg, three laps, and you start at the back of the grid. Scraping the barriers costs energy, two boost pads throw you forward, and the race positions update live. The arcade mover gains grip and a brake, rivals fly a racing line, and the camera rides behind your craft. This builds on tutorial 11, Run-and-gun.
▶ Play the finished game: ← → steer, ↑, W or Space accelerates, ↓ or S brakes, R races again. On a phone: ◀ ▶ ▼ ▲.
1. Lay out the track
Section titled “1. Lay out the track”The track is a closed loop: a centreline with rounded corners. Everything else follows it.
-
Save a new file as
hover-racer.blend. Model the road along your loop, with curbs along both edges. -
Add the barriers along both edges as Arcade Line Wall objects (Add Component ▸ Arcade ▸ Arcade Line Wall) with
arcade.wallClosed = 1andarcade.layer = wall. Tutorial 13 explains these walls in full. -
Add the racing line: an Empty named
Track.Linewith Path, whosepath.pointsare the centreline’s points asx,zpairs in world coordinates, in the direction of travel. -
Add eight checkpoints across the road as trigger lines: Arcade Line Wall with
arcade.wallSensor = 1andarcade.layer = check, namedCheck0(the start and finish line) toCheck7. -
Add two boost pads as Arcade Sensor in the layer
boost.
2. Give the craft the vehicle body
Section titled “2. Give the craft the vehicle body”The craft is an Arcade Mover steered like the ship in tutorial 2, plus grip and a brake.
| Tag | Value | What it does |
|---|---|---|
arcade.turn · arcade.turnSpeed |
steer · 125 |
Steering, in degrees per second |
arcade.thrust · arcade.thrustAccel |
accel · 17 |
Accelerating |
arcade.drag |
0.5 |
With thrust 17, the craft heads for 17 ÷ 0.5 = 34 m/s |
arcade.maxSpeed |
46 |
A speed it never exceeds |
arcade.grip |
5 |
Speed sideways to the heading bleeds off at 5 per second, so the craft goes where it points. Turn hard and it drifts a moment, then lines up |
arcade.brake · arcade.brakeDecel |
brake · 30 |
Braking, in m/s² |
arcade.collide |
1 |
A barrier stops the craft and it slides along |
arcade.radius |
0.9 |
The circle it meets segment walls with |
arcade.layer · arcade.hits |
player · wall,rival |
Each hit is an event the rules turn into an energy cost |
-
Model the player’s craft, name it
Player, and give it Arcade Mover with the tags above. -
In World ▸ Simulacrum ▸ Input, add
steer=keys:ArrowLeft/KeyA,ArrowRight/KeyD,accel=keys:ArrowUp/KeyW/Space,brake=keys:ArrowDown/KeySandagain=keys:KeyR/Enter, and a pad menusteer@-1=◀|steer@1=▶|brake=▼|accel=▲shown whileplaying. -
Model five rivals,
Rival0toRival4, each an Arcade Mover in the layerrival, standing on the grid ahead of the player.
Two more methods help a race. control with 0 locks the player’s steering and thrust (the craft still coasts and collides), and control with 1 frees them: a countdown. heading reads or sets the craft’s heading in degrees, for a respawn that faces down the track.
3. Send the rivals round the racing line
Section titled “3. Send the rivals round the racing line”followPath in loop mode flies a closed path forever, in world coordinates, from the point nearest the craft, a set number of metres to the right of the line (negative is left), facing along it. Its argument is the line’s name, 1, a speed, loop and the lane: Track.Line,1,26,loop,-3.
-
Add
data/rivals.jsonwith one row per rival: itsname, itspacein m/s and itslanein metres. -
At GO, one For Loop over the table’s rows (a Data Table gives each rival’s name, pace and lane) calls
followPathon each rival. -
For race positions, ask each rival its
progress(laps flown plus the fraction of this one) and compare it with the player’s own progress (laps plus checkpoints passed ÷ 8). Your place is 1 plus the rivals ahead.
pathSpeed changes a rival’s pace on the fly. Rivals fly the line and push nothing; touching one costs the player speed and a little energy. reset also ends a rival’s path, so Race again parks every rival back on its grid slot.
4. Ride behind the craft
Section titled “4. Ride behind the craft”Set the camera in Properties ▸ Scene ▸ Custom Properties:
| Tag | Value | What it does |
|---|---|---|
camera.mode |
chase |
The camera rides behind a moving object, in its frame |
camera.chase |
Player |
The object it rides behind |
camera.chaseOffset |
0,3.2,8.5 |
Where it sits in the craft’s frame (forward is −z, so behind is +z) |
camera.chaseLook |
0,0.6,-12 |
A point ahead of the craft that it looks at |
camera.chaseEase |
6 |
How fast it catches up. A jump of more than 15 m in one frame snaps |
camera.fov |
70 |
Its field of view |
5. Write the rules
Section titled “5. Write the rules”-
The countdown. Lock the player with
control 0, count down on the HUD, and free it withcontrol 1at GO. -
Checkpoints in order. Crossing the next checkpoint advances
nextCheck. Crossing the line (checkpoint 0) counts a lap, and on the last lap it finishes the race. A jump to a later checkpoint counts nothing, so cutting the course gains nothing. -
Lap times. Time each lap with the game clock. The best lap is a persistent variable saved for the player.
-
Energy. −6 for each barrier hit, −3 for each bump with a rival, +1 every second. At 0 the craft is WRECKED.
-
Boost. On contact with a boost pad, set the craft’s velocity to its
forwardat its currentspeed+ 12. -
The HUD.
Lap {lapShown}/3 · P{pos} of 6 · {kmh} km/h · Energy {energy}at the top, the countdown in the centre, and Race again when finished.
6. Build and play
Section titled “6. Build and play”-
Press Build Cartridge, then publish the game (Publish and share).
-
Open it and hold accelerate at GO: the rivals pull away along the racing line, and a hard turn drifts for a moment before the craft lines up again.
Limits
Section titled “Limits”The add-on has no button yet that rounds a polygon into a track or turns a curve into path.points or barrier lines. Type the points yourself (x is Blender’s X, z is minus Blender’s Y), or copy them from your model’s vertices.
What you learned
Section titled “What you learned”- Grip and a brake turn the arcade mover into a vehicle;
controlandheadingserve a race start and a respawn. followPathin loop mode sends rivals round a racing line, in lanes, with liveprogress.- The chase camera rides behind the craft.
Next: Tracks from real streets races the same game on a loop of real streets.